Is there a way to know how many times a specific message has been redelivered?
There's the method getCMSRedelivered()
of the class cms::Message
, that works alright but returns a boolean.
There's also the method getRedeliveryCounter()
of the class activemq::core::commands::Message
, but that's an inner class I'd rather not access directly.
Thanks.
It's retrievable through the reserved vendor property in your Message:
getIntProperty("JMSXDeliveryCount");
or:
getLongProperty("JMSXDeliveryCount");