sliebeskind
Dec 10th, 2005, 04:38 PM
Is there some way to use Spring 1.2.6 JMS classes to drain a JMS queue of messages?
I'm relatively new to JMS programming, but I do know there is a method called receiveNoWait on the interface javax.jms.MessageConsumer, which would pull off any waiting message, or return a null message if nothing is waiting. That's the functionality I am looking for. The logical place to me, the novice, to find this functionality would be in the JmsTemplate class (a method called JmsTemplate.receiveNoWait?), but JmsTemplate receive methods end up triggering calls only to MessageConsumer.receive() and MessageConsumer.receive(<timeout value>) , there's no reference to MessageConsumer.receiveNoWait.
I can fake receiveNoWait, I guess by calling receive with at tiny timeout value, but is that the right way to go? Is there some other way using Spring (perhaps not involving the JMSTemplate at all) if I want to drain a given queue of all messages?
Thanks.
Susan Liebeskind
I'm relatively new to JMS programming, but I do know there is a method called receiveNoWait on the interface javax.jms.MessageConsumer, which would pull off any waiting message, or return a null message if nothing is waiting. That's the functionality I am looking for. The logical place to me, the novice, to find this functionality would be in the JmsTemplate class (a method called JmsTemplate.receiveNoWait?), but JmsTemplate receive methods end up triggering calls only to MessageConsumer.receive() and MessageConsumer.receive(<timeout value>) , there's no reference to MessageConsumer.receiveNoWait.
I can fake receiveNoWait, I guess by calling receive with at tiny timeout value, but is that the right way to go? Is there some other way using Spring (perhaps not involving the JMSTemplate at all) if I want to drain a given queue of all messages?
Thanks.
Susan Liebeskind