[rabbitmq-discuss] Transactions and duplicate

Simon MacMullen simon at rabbitmq.com
Thu Mar 27 17:42:32 GMT 2014


Using transactions does not prevent messages from being duplicated I'm 
afraid. The transactions are quite thin, they are not ACID. See 
http://www.rabbitmq.com/semantics.html

Messages that are in flight can always be duplicated when the client or 
server fails.

Cheers, Simon

On 26/03/14 15:12, lepolac wrote:
> Hello,
>
> When using transactions on the consumer side, I noticed duplicates when a
> node is failing.
> This occurs when the node the consumer is connected to fails, or if the
> master fails.
> It occurs both when catching the consumer cancellation exception and
> reconnecting directly, or using a simpler client and restarting it.
> I used a tx channel with basic.get and no autoack, I manually ack() and
> commit() every message.
>
> Whilst I can understand redelivery/dups when using asynchronous ways of
> consuming, I fail to see why it happens when using synchronous calls.
>
> I can reproduce this everytime, I always get one message redelivered, even
> if the commit() called return.
> I noticed that when throttling the consumer (let's say one message consumed
> every 100ms), I don't get dups.
>
> So, is the commit() call really synchronous ?
> Generally, what would be the best way to avoid duplicates ? I tried
> basicAck() without transactions and got the same results, I get dups.
>
> I'm using 3.2.4 and the java client.
> There's about 1ms latency between rabbit nodes and my client.
>
> Thanks
>
>
>
> --
> View this message in context: http://rabbitmq.1065348.n5.nabble.com/Transactions-and-duplicate-tp34344.html
> Sent from the RabbitMQ mailing list archive at Nabble.com.
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
>


-- 
Simon MacMullen
RabbitMQ, Pivotal


More information about the rabbitmq-discuss mailing list