Hi,

I have a QueueBrowser that is polling a queue. I display this queue in a Swing client. When the user takes an action I want to get the message from the queue, so I make a selector based on the JMSMessageID. Unfortunately this doesn't seem to work.. can somebody tell me what I'm doing wrong? Below is a code snippet..

thanx,

Joost

<snippet>
String selector = "JMSMessageID='" + msg.getJMSMessageID() + "'";
// fetch it from the queue
QueueReceiver receiver = session.createReceiver(queue,selector);
msg = receiver.receiveNoWait();
if(msg != null) {
// ok .. we have it put it in some other list
System.out.println("Got Message");
} else {
// @todo: show dialog
System.out.println("Message not available anymore");
}
// close the receiver
receiver.close();
</snippet>

Reply via email to