[rabbitmq-discuss] STOMP and transactions

Tony Garnock-Jones tonyg at rabbitmq.com
Fri Aug 20 17:55:22 BST 2010


Hej Göran,

I spotted your library over on squeak-dev - very cool. I'm pleased you're
trying it out against RabbitMQ.

Transactions in AMQP (and STOMP, though STOMP's semantics are pretty loose) are
not quite what you'd expect given what they mean in the DB world. They are used
to *group* sets of messages ("SEND"s) together (atomically, more or less) so
that either all or none are published. An additional wrinkle is the treatment
of acknowledgements ("ACK"s) of messages delivered to the transacting client
from the server: acknowledgements can be included in a transaction along with
new publications.

This lets e.g. an RPC server receive a request, process it, and then
transactionally both acknowledge the request and send the reply message. If the
transaction commits, the request is deleted from the server's queue, and the
reply is enqueued for the RPC client; if the transaction aborts, the request
remains enqueued waiting for another (or perhaps the same) RPC server instance
to pick it up and work on it, and the reply message is not sent.

With regard to hitting disk: persistence of messages is orthogonal to their
transactionality in messaging systems like AMQP and STOMP.

I hope this helps. I read squeak-dev, too, so feel free to get in touch in
either place if you have further questions.

Regards,
  Tony


Göran Krampe wrote:
> Hi all!
> 
> I am implementing a STOMP lib in Squeak:
> 
> http://www.squeaksource.com/StompProtocol.html
> 
> ...and most of it now works (ACKs and RECEIPT etc) but I need more
> info on how transactions are meant to work. Can someone give me a
> pointer? I am aware that Rabbit has lots of different terms here, but
> what is the "out of the box" meaning of BEGIN/COMMIT using the stomp
> adapter?
> 
> I thought it meant that *nothing* is *delivered* until on COMMIT, but
> that seems a misunderstanding. Is it about making sure hitting disk?
> 
> regards, Göran
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss
> 


More information about the rabbitmq-discuss mailing list