Uploaded image for project: 'ActiveMQ C++ Client'
  1. ActiveMQ C++ Client
  2. AMQCPP-367

failover: receiving duplicate messages after a broker restart

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 3.4.0
    • 3.7.0
    • CMS Impl
    • None
    • GNU/Linux

    Description

      When testing AMQCPP-364/AMQCPP-363, we noticed that on broker shutdown, a listener receives a message twice through onMessage callbacks.

      Testcase for a 5.3 broker
      1) In the onMessage before acknowledging the message, shutdown the broker.
      2) Then acknowledge the message while broker is still off.
      3) Bring the broker back up and you see the message delivered again to the onMessage () callback.

      With a 5.5 broker, the problem also happens when ack'ing the message when the broker is back alive. When ack'ing the firs message, you see an error messag in the broker log:
      WARN | Ignoring ack received before dispatch; result of failover with an outstanding ack. Acked messages will be replayed if present on this broker.
      Ignored ack: MessageAck

      {commandId = 22, responseRequired = false, ackType = 2, consumerId = ID:HOSTNAME-44923-1303316424844-0:0:0:0, firstMessageId = ID:HOSTNAME-58084-1303317597544-0:0:0:0:0, lastMessageId = ID:HOSTNAME-58084-1303317597544-0:0:0:0:0, destination = queue://TESTQUEUE, transactionId = null, messageCount = 1, poisonCause = null}

      A java test program (e.g. the ones in the activeMQ examples directory) work fine: no message duplicates there. When the message gets redelivered to a different client, the second ack'ing results in an exception raised to the java client.

      Kind regards,
      Chris

      Attachments

        Activity

          People

            tabish Timothy A. Bish
            chrmhoffmann Chris Hoffmann
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: