1 Reply Latest reply on May 14, 2010 11:01 AM by andreas_back

    JMSXDeliveryCount is not increased after client shutdown?!

    andreas_back

      Hello!

       

      When testing JBoss Messaging in a migration project from JBoss MQ 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 there 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

       

      One idea was to set DefaultMaxDeliveryAttempts to 1 to let JBoss Messaging move messages into the DLQ 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,

       

      Andreas