You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@activemq.apache.org by ryarger <ri...@gmail.com> on 2008/02/20 22:07:25 UTC

Duplicate messages sent to Queue after broker restarts

I am running the 5.1 SNAPSHOT from 2/19 (have also used 2/12) and I am
noticing that messages are being resubmitted to queues after a broker
restart.
I have tried persisting to both the AMQ Store and to SQL Server. The issue
occurs for both.
I am using Spring's DefaultMessageListenerContainer for the consumer and it
is configured for auto acknowledgment and session transaction is true.

Messages are sent to the queue and processed by the message driven consumer.
I have confirmed that the consumer has completed processing with no
exceptions.
I then stop and start the broker and the messages that were just processed
are sent again.

At first I suspected that I had something misconfigured, but the exact same
code works fine with AMQ 5.0.0.

Any ideas would be helpful.
Thanks.



-- 
View this message in context: http://www.nabble.com/Duplicate-messages-sent-to-Queue-after-broker-restarts-tp15598179s2354p15598179.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Duplicate messages sent to Queue after broker restarts

Posted by ryarger <ri...@gmail.com>.
This was an issue with the 5.1 version. It has been resolved in the 5.3
snapshots.
I don't believe it was fixed in in 5.2. But we never used 5.2, so I am not
100% sure.
We worked around the issue by deleting the data directory before bringing
the broker back up.
Hope that helps.
-Rich



-- 
View this message in context: http://www.nabble.com/Duplicate-messages-sent-to-Queue-after-broker-restarts-tp15598179p25441398.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Duplicate messages sent to Queue after broker restarts

Posted by dbczak <za...@dbconcert.com>.
have you resolved this issue?  I'm having the same issue.  Any help would be
appreciated.
-- 
View this message in context: http://www.nabble.com/Duplicate-messages-sent-to-Queue-after-broker-restarts-tp15598179p25440677.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Duplicate messages sent to Queue after broker restarts

Posted by dbczak <za...@dbconcert.com>.
Unfortunately, my testing with the latest snapshot has the same problem. 
I've created my own case for this to see if I get more responses (link
below).  I appreciate your help.

http://www.nabble.com/Duplicate-Messages-on-Listener-Restart-td25440673.html
-- 
View this message in context: http://www.nabble.com/Duplicate-messages-sent-to-Queue-after-broker-restarts-tp15598179p25443652.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Duplicate messages sent to Queue after broker restarts

Posted by ryarger <ri...@gmail.com>.
The DefaultMessageListenerContainer is supposed to handle the commit for you,
but I did try manually committing the session and I was still able to
reproduce the issue.

I have also confirmed that both the AMQ admin web page and the jconsole show
these messages as having been dequeued and a queue size = 0 right before I
bounce the broker.

So AFAICT the messages have been acknowledged and the transactions have been
committed, but the messages are redelivered as soon as the broker comes back
up.
-- 
View this message in context: http://www.nabble.com/Duplicate-messages-sent-to-Queue-after-broker-restarts-tp15598179s2354p15612899.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.


Re: Duplicate messages sent to Queue after broker restarts

Posted by David Sitsky <si...@nuix.com>.
ryarger wrote:
> I am running the 5.1 SNAPSHOT from 2/19 (have also used 2/12) and I am
> noticing that messages are being resubmitted to queues after a broker
> restart.
> I have tried persisting to both the AMQ Store and to SQL Server. The issue
> occurs for both.
> I am using Spring's DefaultMessageListenerContainer for the consumer and it
> is configured for auto acknowledgment and session transaction is true.
> 
> Messages are sent to the queue and processed by the message driven consumer.
> I have confirmed that the consumer has completed processing with no
> exceptions.
> I then stop and start the broker and the messages that were just processed
> are sent again.
> 
> At first I suspected that I had something misconfigured, but the exact same
> code works fine with AMQ 5.0.0.

If you have session transactions as true - are you calling commit() 
after you have successfully processed the message (or does 
DefaultMessageListenerContainer do that for you)?

Before you shutdown the broker, connect to it with jconsole and inspect 
the queue to see if there are still messages present.  On my system I 
use the following command, so you'll need to update the paths appropriately:

"c:\Program Files (x86)\Java\jdk1.6.0_02\bin\jconsole" 
service:jmx:rmi:///jndi/rmi://localhost:1099/jmxrmi

Trying calling session.commit() explicitly to see if it makes any 
difference.

-- 
Cheers,
David

Nuix Pty Ltd
Suite 79, 89 Jones St, Ultimo NSW 2007, Australia    Ph: +61 2 9280 0699
Web: http://www.nuix.com                            Fax: +61 2 9212 6902