ActiveMQ redelivered messages and NMS

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

ActiveMQ redelivered messages and NMS

magellings
Hello

If a consumer processes a message and the session is rolled back then the message is redelivered.  The question I have is if this consumer dies (or the session/connection disposed) before the message is redelivered its maximum redelivered count can another consumer pick up this redelivered message to continue processing it?

I've been seeing mixed behavior with how this works.  It seems like if the above does happen (consumer dies or disposed before maximum redelivered count) that the message sits in the queue and cannot be picked up again.  If the maximum redelivered count is achieved then the message gets transferred to the DLQ.  If one tries to process the messages on the DLQ I'm also seeing mixed behavior where sometimes the messages are picked up and sometimes not.  When the messages are picked up the maximum redelivery count is set to 10 and when the messages come through from the DLQ the redelivered count is set to 11 as I can see on the message property of the client.

I've searched for an answer to this but couldn't find anything specific on how to reprocess a redelivered message which hasn't exhausted its set maximum redelivery count.  I've also searched for an answer on how DLQ processing works and if one should be or should not be able to pull the message from the queue or if manual intervention is required.  There is a session.recover method supposedly on the java implementation but I did not see one specifically on the NMS provider, albeit there is some code pertaining to RECOVER transactions in the NMS provider.

I'm a bit confused on all of this and was wondering if someone could shine some light on just what the expected behavior is?

Appreciate any replies.

-Thanks