Contents

When a client receives a message the mandatory JMS-defined message property JMSXDeliveryCount will be set to the number of times the message has been delivered.

How to access:

in javax.jms.Message:

The purpose of the JMSXDeliveryCount property is to allow consuming applications to identify whether a particular message is being repeatedly redelivered and take appropriate action.

Icon
  • Not applicable to Journalling and snooping.
  • Not applicable to LVC.

JMSXDeliveryCount property is not persisted, so not guaranteed to be exactly correct in server restart/failover. This property is also not propogated to backup server for high availability deployments. In case of server failure, if message is redelivered, it will be delivered with JMSXDeliveryCount as 2.

Following cases on client side are considered are redelivery attempts:

  1. MessageListener#onMessage() throwing RuntimeException: message will be redelivered with increased delivery count.
  2. in trasacted session and CLIENT_ACK mode: session.rollback() and queueReceiver.recover() will cause message to redelivered with increased delivery count.
Icon

Above cases are considered to be client-side redeliveries and server is not notified about it for performance reasons.



Adaptavist ThemeBuilder EngineAtlassian Confluence