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

Java client releases messages in an unpredictable order on recover

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.6
    • 0.7
    • JMS AMQP 0-x
    • None

    Description

      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.

      Attachments

        1. QPID-2471.patch
          9 kB
          Rajith Muditha Attapattu

        Activity

          People

            rajith Rajith Muditha Attapattu
            rajith Rajith Muditha Attapattu
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: