[rabbitmq-discuss] Transactions

Tim Watson tim at rabbitmq.com
Wed Dec 19 11:38:18 GMT 2012


John,

Please start a new thread when asking a new topic. It's very difficult 
to keep track of your posts otherwise, and it therefore takes us longer 
to help! Thanks.

So on the subject of transactions...

On 12/17/2012 07:15 PM, John Smith wrote:
> Am I correctly interpreting the following link:
> http://www.rabbitmq.com/semantics.html
> I can have publish inside a transaction, but not receive inside a tx,

You can of course receive messages inside a transaction, however that 
*receipt is not transactional* but rather the acknowledgement you send 
for it is. What this means in practise is that once delivered, a message 
arriving during a transaction will not be redelivered even if you roll 
back the transaction. On the broker, if you send back an ACK the message 
is normally then removed from the queue, and not before then, so that 
nack/reject work as expected. If you send an ACK during a transaction 
and subsequently roll back the transaction, the message will *not* be 
removed from the queue nor will it be delivered to you again! That is 
what the AMQP spec means when it distinguishes between atomic delivery 
(which isn't mandated or supported) and atomic acknowledgements (which 
are). As per the spec, if you're holding onto a message received during 
a transaction that was subsequently rolled back, it is valid to ACK that 
message at a later time in a subsequent transaction.

> and the transaction is not atomic ?
>

Transactions in AMQP are atomic for a single queue, but RabbitMQ does 
not uphold the atomicity guarantee in the face of failure during the 
commit phase.

> Could someone please post a link to where I can view an example of a 
> transaction in Rabbit ?
>

If you explain what you're specifically trying to achieve with 
transactions, then we can probably point you in the right direction.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20121219/3ec7402e/attachment.htm>


More information about the rabbitmq-discuss mailing list