When JMSXDeliveryCount get increased
What are the conditions in which JMSXDeliveryCount is increased in WebSphere MQ. I need all the scenarios under which it can happen.
The JMSXDeliveryCount is incremented every time a message is re-delivered to a consumer. A message could be redelivered:
1) A consumer using the Client Acknowledge mode received the message earlier did not call acknowledge() on that message.
2) A consumer received the message in a transaction, did not call a commit or called a rollback.
If the JMS Client is unable to process the message due to some bad JMS headers, then such a message(known as poison message) will not be delivered to application and JMS client will internally rollback that message. In this case also JMSXDeliveryCount is incremented.
In IBM MQ, have you set Backout Queue and Backout Threshold properties for the queue from which messages are being retrieved? JMS Client will put such bad messages to the backout queue once the Backout Threshold is reached. This is to avoid same message is retrieved by JMS client again and again thus blocking other good messages from being delivered to application.