ActiveMQ
  1. ActiveMQ
  2. AMQ-3846

The JMX message move, copy and remove operation do not take messages in FIFO order

    Details

    • Type: Bug Bug
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: 5.5.1, 5.6.0
    • Fix Version/s: 5.7.0
    • Component/s: JMX
    • Labels:
      None

      Description

      When a page is pulled in, it is placed in a LinkedHashMap which preserves the queue order, but the below code then pulls the values from the LinkedHashMap and puts them in a Set. This causes the FIFO order of the queue to be lost. If the number of max messages to move is smaller the the page size, then the outcome looks like random messages from the queue being moved (copied or removed).

      ...

      Set<MessageReference> set = new HashSet<MessageReference>();
      ConnectionContext context = createConnectionContext();
      do {
      doPageIn(true);
      pagedInMessagesLock.readLock().lock();
      try

      { set.addAll(pagedInMessages.values()); }

      finally

      { pagedInMessagesLock.readLock().unlock(); }

      ...

      Can this be changed to preserve the queue order?

        Activity

        Hide
        Timothy Bish added a comment -

        Do you have a unit test case for this, would help to ensure any fix remains fixed in the future.

        Show
        Timothy Bish added a comment - Do you have a unit test case for this, would help to ensure any fix remains fixed in the future.
        Hide
        Timothy Bish added a comment -

        Fix and new tests added to trunk.

        Show
        Timothy Bish added a comment - Fix and new tests added to trunk.

          People

          • Assignee:
            Timothy Bish
            Reporter:
            David Harp
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development