getting message in queue using java