F.O.O
F.O.O

Reputation: 4960

JMSXDeliveryCount in Dead Letter Queue

Any idea how to get the actual redelivery count of a message after it reaches the Dead Letter Queue. Appears, Artemis see this as a new delivery, and resets the counter to 1.

See illustration below: 1. Message is consumed by the MDB. 2. Something bad happens and I call setRollbackOnly on the context until max retry attempts of 3 is reached. 3. Artemis sends message to configured DLQ. 4. DLQ Mdb consumes message, but JMSXDeliveryCount on message reads 1 instead of 3.

Any idea, how to retrieve the retry count 3 from DLQ?

Upvotes: 0

Views: 519

Answers (1)

Justin Bertram
Justin Bertram

Reputation: 35217

I don't believe there's an easy way to do what you want at this point. To deduce the delivery count of the original message you could grab the "_AMQ_ORIG_ADDRESS" property from the message and use that to query the broker using the ActiveMQServerControl#getAddressSettingsAsJSON management method. The output from that method will contain the "maxDeliveryAttempts" configured for that address which should correspond to the JMSXDeliveryCount of the message when it was sent to the dead-letter address.

Upvotes: 0

Related Questions