ActiveMQ
  1. ActiveMQ
  2. AMQ-3436

Support Prioritization Of Messages Pending Dispatch

    Details

    • Type: Improvement Improvement
    • Status: Resolved
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: 5.5.0
    • Fix Version/s: 5.6.0
    • Component/s: Broker
    • Labels:
      None
    • Patch Info:
      Patch Available

      Description

      ActiveMQ does not deliver messages in priority order when the following conditions are true:

      1. A consumer has prefetch set to one (or zero).
      2. The consumer is created (consumerSession.createConsumer) prior to message delivery
      3. Large maxPageSize is configured

      The fix is to modify org.apache.activemq.broker.region.Queue to use a PrioritizationPendingList for the message in "pagedInPendingDispatch" so they are dispatched in priority order.

      A test case reproducing the issue is included.
      The patched file deltas are included.

      1. PendingList.java-patch.txt
        0.9 kB
        Kevin Urciolo
      2. OrderedPendingList.java-patch.txt
        1 kB
        Kevin Urciolo
      3. PrioritizedPendingList.java-patch.txt
        1 kB
        Kevin Urciolo
      4. Queue.java-patch.txt
        11 kB
        Kevin Urciolo
      5. AMQPriorityTest.java
        7 kB
        Kevin Urciolo

        Activity

        Hide
        Timothy Bish added a comment -

        Patch applied with thanks. Required some modifications. Patch broke some Temp Destination functionality as the TempQueue class has its own init method. Test also needed a few tweaks as well.

        Show
        Timothy Bish added a comment - Patch applied with thanks. Required some modifications. Patch broke some Temp Destination functionality as the TempQueue class has its own init method. Test also needed a few tweaks as well.
        Hide
        Gary Tully added a comment -

        patch and test, should put in 5.6

        Show
        Gary Tully added a comment - patch and test, should put in 5.6
        Hide
        Kevin Urciolo added a comment -

        These are the changes required to have the pending message list for the dispatcher in Queue.java use the PendingList class.

        Show
        Kevin Urciolo added a comment - These are the changes required to have the pending message list for the dispatcher in Queue.java use the PendingList class.
        Hide
        Kevin Urciolo added a comment -

        This is the junit test that reproduces the issue.

        Show
        Kevin Urciolo added a comment - This is the junit test that reproduces the issue.

          People

          • Assignee:
            Timothy Bish
            Reporter:
            Kevin Urciolo
          • Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development