You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@activemq.apache.org by "Chris Hoffmann (JIRA)" <ji...@apache.org> on 2011/04/26 18:03:03 UTC
[jira] [Created] (AMQCPP-367) failover: receiving duplicate
messages after a broker restart
failover: receiving duplicate messages after a broker restart
-------------------------------------------------------------
Key: AMQCPP-367
URL: https://issues.apache.org/jira/browse/AMQCPP-367
Project: ActiveMQ C++ Client
Issue Type: New Feature
Components: CMS Impl
Affects Versions: 3.4.0
Environment: GNU/Linux
Reporter: Chris Hoffmann
Assignee: Timothy Bish
Fix For: 3.5.0
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
--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira