Basically all I want to do is to get messages off a queue.
The below code works great if there are messages on the queue. However once the queue is depleted MQQueue.get throws and exception.
I could solve it by surrounding it all in a try-catch loop and so on, but that jsut screams dirty. So how should I do a very simple minimal implementation?
Any help/links (I've searched for this extensively) would be greatly appreciated!
I don't see that the queue.get method has any choice but to throw an exception once the wait time has expired. Not the way it's designed. So catch the exception.
Steve Harney
Greenhorn
Joined: Jun 19, 2010
Posts: 18
posted
1
you could check the queue for messages before asking for one. ie
Bjorne Karlsson
Greenhorn
Joined: Dec 08, 2010
Posts: 2
posted
0
Steve Harney wrote:you could check the queue for messages before asking for one. ie