[rabbitmq-discuss] transacted channel vs txSelect()

Matthias Radestock matthias at rabbitmq.com
Tue Sep 25 08:09:00 BST 2012


On 21/09/12 13:42, Majid Azimi wrote:
> 1. What is difference between using transacted channel using txSelect()
> and not transacted channel and manually acknowledging he message? It
> seems to me they do the same thing.

There is indeed little point to using transactions in pure consumers.

One thing you do get with consumers in tx mode, is a confirmation - in 
form of the tx.commit-ok - that the acks have reached the server. They 
could still get lost in a server crash after that point though.

> 2. When using basicConsume() in transacted channel what is acknowledging
> mode? autoack = true? In JMS when we use transacted session there is
> nothing like manual acknowledging. Is this true here?

The ack mode is selected with the autoAck flag of basicConsume. See 
http://www.rabbitmq.com/releases/rabbitmq-java-client/v2.8.6/rabbitmq-java-client-javadoc-2.8.6/com/rabbitmq/client/Channel.html#basicConsume%28java.lang.String,%20boolean,%20com.rabbitmq.client.Consumer%29

In tx mode, acks (and nacks/rejects) are transactional, i.e. they are 
acted upon only on commit and undone on rollback.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list