activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Rob Davies <rajdav...@gmail.com>
Subject Re: Duplicate Messages on Listener Restart
Date Tue, 15 Sep 2009 04:20:03 GMT

On 15 Sep 2009, at 04:15, Bruce Snyder wrote:

> On Mon, Sep 14, 2009 at 12:25 PM, dbczak <zak@dbconcert.com> wrote:
>>
>> Hi,
>>
>> I have a message client that produces a message and sends to multiple
>> listeners by using the URL:
>> fanout:(static:(tcp://host1:61616,tcp://host2:61616,tcp://host3:61616
>> ...))?fanOutQueues=true&minAckCount=1
>>
>> I'm getting duplicate messages whenever any of the listener is shut  
>> down and
>> restarted but the sender is not.  For example:
>>
>> I start 2 listeners.
>> I run the sender which sends one message - both listeners receive and
>> acknowledge.
>> I shut down one of the listeners.
>> The sender then sends another message which only reaches one of the
>> listeners.
>> I bring the listener that is down back up.  - At this point, this  
>> listener
>> receives both the first message that it already processed and the new
>> message it missed.  It should only receive the one it missed, but I  
>> can't
>> stop the other one from coming in too.
>>
>> The code for both the listener (TIPServer.java) and sender  
>> (TIPClient.java)
>> are attached.
>>
>> http://www.nabble.com/file/p25440673/TIPServer.java TIPServer.java
>>
>> http://www.nabble.com/file/p25440673/TIPClient.java TIPClient.java
>
> What behavior are you expecting by using the fanout transport and the
> fanOutQueues=true transport option?
>
> Please make sure to read everything on the following page regarding
> the fanout transport:
>
> http://activemq.apache.org/fanout-transport-reference.html
>
> Bruce
> -- 
> perl -e 'print unpack("u30","D0G)U8V4\@4VYY9&5R\"F)R=6-E+G-N>61E<D\! 
> G;6%I;\"YC;VT*"
> );'
>
> ActiveMQ in Action: http://bit.ly/2je6cQ
> Blog: http://bruceblog.org/
> Twitter: http://twitter.com/brucesnyder


I think the main thing to note is to not use fanout:// transport for  
consumers - its for producers only

cheers,

Rob Davies
http://twitter.com/rajdavies
I work here: http://fusesource.com
My Blog: http://rajdavies.blogspot.com/
I'm writing this: http://www.manning.com/snyder/






Mime
View raw message