Uploaded image for project: 'ActiveMQ'
  1. ActiveMQ
  2. AMQ-6796

Acknowledging messages out of order in a STOMP 1.1 transaction raises exception

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 5.15.0
    • Fix Version/s: 5.15.1, 5.16.0
    • Component/s: STOMP
    • Labels:
      None

      Description

      Reproducing the problem:

      • Receive two messages via STOMP on a subscription with ack:client-individual
      • Start a transaction
      • Acknowledge message #2
      • Acknowledge message #1
      • Commit the transaction

      Expected behaviour:

      • Both messages are acknowledged, life goes on

      Observed behaviour:

      • Exception is raised

      {{javax.jms.JMSException: Unmatched acknowledge: MessageAck

      {commandId = 0, responseRequired = false, ackType = 2, consumerId = ID:(...)-6:555:-1:1, firstMessageId = null, lastMessageId = ID:(...)-6:555:-1:1:1, destination = queue://(...), transactionId = null, messageCount = 2, poisonCause = null}

      ; Expected message count (2) differs from count in dispatched-list (1)
      at org.apache.activemq.broker.region.PrefetchSubscription.assertAckMatchesDispatched(PrefetchSubscription.java:519)
      at org.apache.activemq.broker.region.PrefetchSubscription.acknowledge(PrefetchSubscription.java:211)
      at org.apache.activemq.broker.region.AbstractRegion.acknowledge(AbstractRegion.java:528)
      at org.apache.activemq.broker.region.RegionBroker.acknowledge(RegionBroker.java:475)
      (..)}}

      I have prepared a unit test for this (patch file).

      The exception is not raised if the messages are acknowledged outside of a transaction.

        Attachments

          Activity

            People

            • Assignee:
              tabish Timothy A. Bish
              Reporter:
              mgerstel Markus Gerstel
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: