Uploaded image for project: 'Qpid'
  1. Qpid
  2. QPID-2471

Java client releases messages in an unpredictable order on recover


    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.6
    • Fix Version/s: 0.7
    • Component/s: JMS AMQP 0-x
    • Labels:


      As per the JMS spec, If "recover" is called on a session, the client should stop message delivery for that session, and restarts message delivery with the oldest unacknowledged message.
      It also says that "Redelivered messages do not have to be delivered in exactly their original delivery order".

      However it's nice to ensure ordering where possible.
      Looking at the code (alteast the 0-10 codepath) it seems we are not making a reasonable effort in ensuring we release all messages when in prefetch mode.
      Quite often messages are stuck in the pre-delivery dispatch queue or the individual consumer queues.
      This results in the messages being delivered out of order.

      Here the steps that would need to do to ensure recovery is done properly and if possible to ensure ordering.
      1. Flush any message acks kept in buffer.
      2. Stop the message flow.
      3. Drain the dispatch queue and the queues in each consumer
      4. Reject/release all unacked messages.
      5. Start the message flow again.

      It is also nice to have a test case to ensure that ordering is maintained under reasonable circumstances.


        1. QPID-2471.patch
          9 kB
          Rajith Attapattu



            • Assignee:
              rajith Rajith Attapattu
              rajith Rajith Attapattu
            • Votes:
              0 Vote for this issue
              0 Start watching this issue


              • Created: