3 Replies Latest reply on Mar 23, 2009 10:52 AM by azda

    AUTO_ACKNOWLEDGE and Duplicate Delivery of Messages

      I'm trying to figure out if I'm misunderstanding this functionality, or there is an issue.

      The JMS spec section 4.4.12 states that if the client is using AUTO_ACKNOWLEDGE mode, it must prepare for redelivery of the last consumed message (since it could do some work and crash before acknowledgment). It also specifies that JMSRedelivered will be set under that circumstance.

      I set up a persistent Queue, and a simple asynch client using:

      session = connection.createSession(false, Session.AUTO_ACKNOWLEDGE)

      My onMessage prints out the message (including the status of JMSRedelivered), then goes to sleep to simulate doing work, and to give me some time to perform a 'crash'.

      When onMessage is sleeping I performed two tests:

      1.) I terminate the client. When I start up my client again, the same message is delivered (expected as per 4.4.12), but JMSRedelivered is false (unexpected).
      2.) I perform the same test, but crash the provider with the same results (JBossAS 5.0.1GA). JMSRedelivered is false.

      Maybe I'm misunderstanding the extent to which JMS guarantees these semantics.