There is no correct way, both are correct. Calling close() to unsubscribe and session.addConsumer() to subscribe again is the most efficient... but if you can detect the hang and again return from your listener or call receive() again that will also suffice.
When you say hang, what component blocks and why? On 30 August 2011 15:30, manua <[email protected]> wrote: > HI, > > I have activemq setup with a consumer on a queue. > If the consumer hangs, there are pending messages in the queue. > > To consume those messages, I restart the consumer. > > To restart should I just unsubscribe/subscribe to the queue or should I > completely disconnect from the broker and reconnect. > > What is the correct way to do this. > > Thanks > Manu > > -- > View this message in context: > http://activemq.2283324.n4.nabble.com/To-pick-pending-messages-consumer-should-just-unsubscribe-subscribe-or-completely-disconnect-connectr-tp3778860p3778860.html > Sent from the ActiveMQ - User mailing list archive at Nabble.com. > -- http://fusesource.com http://blog.garytully.com
