[rabbitmq-discuss] Fwd: question on the faq

Gordon Sim gsim at redhat.com
Mon Jan 5 17:37:01 GMT 2009


Tim Coote wrote:
> I've now read a bit of the specs :-)
> amqp defines tx classes (which are not transactional in the sense of 
> XOpen's XA specification) and dtx, which are.  I don't understand, at 
> the moment, what tx really means in the context of a message passing 
> system, but I suspect that it's something to do with some sort of 
> 'transactional' model with a message server (or whatever I call the 
> agent that my application interacts with that is its interface to the 
> messaging system): I can send messages to the message server with 
> transactional semantics, but there's no downstream semantics. I'm not 
> very clear on how this is a useful piece of functionality as I cannot 
> see what guarantees I get for it.

As an example, imagine a task queue to which jobs are submitted. A 
'worker' takes a message from this queue, performs some processing and 
then publishes a response to a specified reply queue.

If this happens under an atomic transaction, then either the response is 
enqueued *and* the task it corresponds to is dequeued or the task 
remains on the queue to be reprocessed and the response is discarded.

That is my view of what the tx class is for and one example of why it 
can be useful.

All dtx adds to the picture is allowing that transaction to also include 
operations on other resources. E.g. in the example above it might be 
that the job involves some updates to the database and these can be made 
atomic w.r.t the enqueue of the response and the dequeue of the job itself.





More information about the rabbitmq-discuss mailing list