[jboss-user] [JBoss Messaging] - JMSXDeliveryCount is not increased after client shutdown?!

andreas_back do-not-reply at jboss.com
Fri May 14 04:55:36 EDT 2010

andreas_back [http://community.jboss.org/people/andreas_back] created the discussion

"JMSXDeliveryCount is not increased after client shutdown?!"

To view the discussion, visit: http://community.jboss.org/message/543041#543041


When testing this JBoss Messaging the following behaviour is observed:

1. A message ist sent to the queue.
2. The message is processed in the onMessage method of a MessageListener in a client.
3. Within the onMessage method the JMSXDeliveryCount parameter is logged by msg.getIntProperty("JMSXDeliveryCount"); This first time the value is 1.
4. For testing purposes the client is shutdown (for example by Control-C under Linux or by shutting down the java process in the Netbeans IDE) while the onMessage method is processed.
5. After waiting more the 5 minutes the client is started again.
6. The original  message is processed by the client again and msg.getIntProperty("JMSXDeliveryCount") returns the value 1 again.

*The question is:* 

Are the parameters (perhaps in the messaging-service.xml) to influence JBoss Messaging to increase the JMSXDeliveryCount if the message is redelivered in this case of abnormal client termination?

Or is it bug in my thinking of what JBoss Messaging should do or in JBoss Messaging itself?

*The context of this question is the following*:

We are still not able to solve the problem that has been described in   https://community.jboss.org/thread/151812 https://community.jboss.org/thread/151812

One idea was to set DefaultMaxDeliveryAttempts to 1 to let JBoss Messaging move messages into the dead queue if the messages are redelivered.

This does work if the client does call

     (Session s).recover();

as it is done in the JMSXDeliveryCountTest class. If (Session s).recover() is called then the JMSXDeliveryCount is increased. This can be observed when the message is processed the next time and also in the JBM_MSG_REF.delivery_count attribute in the database.

It is essential for us to prevent the redelivery of a message that kills a service-unit (a client) as a result of a system error in the message processing within the client. Such a message could iteratively shutdown a whole array of service-units..

Thanks in advance,



Reply to this message by going to Community

Start a new discussion in JBoss Messaging at Community

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/jboss-user/attachments/20100514/04216bcc/attachment-0001.html 

More information about the jboss-user mailing list