I was reading the
Semantics of Tx article and there is something I would like to validate:
> AMQP guarantees atomicity only when transactions involve a single queue, i.e. all the publishes inside the tx get routed to a single queue and all acks relate to messages consumed from the same queue. When multiple queues are involved it is possible that in the event of a broker failure during tx.commit the effects of the transaction are only visible in some of the queues. Furthermore, RabbitMQ provides no atomicity guarantees even in case of transactions involving just a single queue, e.g. a fault during tx.commit can result in a sub-set of the transaction's publishes appearing in the queue after a broker restart.
Oh boy, those are pretty lousy transaction guarantees :-)
Anyways, focusing on the part that talks about multiple queues in transactions: if I am understanding this correctly, this implies that any publishing of messages to fanout or topic exchanges with more than one target queue cannot guarantee the atomicity of the transaction as per the explanation above.
The thing is that one way to interpret the statement above could be simply about writing a transaction that explicitly publishes to different queues directly like
ch.txSelect();
ch.basicPublish("", QUEUE_NAME1, MessageProperties.PERSISTENT_BASIC, "nop".getBytes());ch.basicPublish("", QUEUE_NAME2, MessageProperties.PERSISTENT_BASIC, "nop".getBytes());ch.txCommit();
But I suppose this would be pretty much the same thing as to publish to a fanout or topic exchange that would end up sending messages to those two queues as well.
channel.basicPublish(EXCHANGE_NAME, "", null, message.getBytes());
So, I just would like to validate that the interpretation of statement above means both things, and not just the first, because at least in my experience the first case might be more unusual within a transaction, but the second one is very, very common, and so I just want to understand the implications of a failure like the one described above.
Am I interpreting this correctly?