[rabbitmq-discuss] is anybody using tx?

Tim Fox tim at rabbitmq.com
Mon Jun 27 16:19:39 BST 2011

On 27/06/11 16:02, Matthias Radestock wrote:
> What use, if any, are RabbitMQ users finding for AMQP's tx class?
> The predominant application of tx we have seen in the past is as a 
> means for the client to ensure that the server has accepted 
> responsibility for a published message (or, conversely, be told of any 
> failure to do so). Publisher confirms, which we introduced in 2.3.0, 
> handle this much better. I suppose there might be still be users that 
> haven't switched from 'tx' to 'confirm'. If so I'd like to know what 
> is holding you back.
The semantics of tx and confirms are somewhat different (atomicity)

An example would be an order that contains several order items. Each 
order item is represented by a message sent to an order queue. If all 
order items for a particular order are sent in a transaction, then we 
know that if the tx committed ok, all items will hit the server and can 
be processed, otherwise no items (no partial order) will be available on 
the server.

With confirms, if a failure occurs mid way through sending the items you 
could end up with an incomplete order on the server, resulting in the 
customer only receiving some of the items they ordered.

You might say, just resend the items we didn't get confirms for when the 
system restarts after failure. Problem with that is it requires the 
client to store every item persistently, so it can resend them after 
crashing. This is a lot more work for the client to do.

Another issue is if you want to implement JMS on top of AMQP you 
wouldn't be able to do that with tx.

More information about the rabbitmq-discuss mailing list