[rabbitmq-discuss] several further questions

Emile Joubert emile at rabbitmq.com
Thu Jun 7 12:34:06 BST 2012


Hi,

On 06/06/12 11:19, pangj wrote:
> * What's the difference between "consume" and "get" for a consumer?

The one is asynchronous and the other synchronous. When a client uses
"consume" the broker will deliver messages as soon as any are available,
while with "get" the client needs to poll the broker.

> * Where to setup the message acknowledgment?

Clients decide on this via the "no-ack" parameter of the "basic.consume"
or "basic.get" methods.

http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.consume.no-ack
http://www.rabbitmq.com/amqp-0-9-1-reference.html#basic.get.no-ack

> * If message acknowledgment is enabled, will the consumer send the ACK 
> automatically, or by a method call?

If the consumer set "no-ack/auto-ack" true then the broker will not
expect acknowledgements from the consumer.
If the consumer set "no-ack/auto-ack" false then the consumer must
acknowledge messages using the basic.ack method:

http://www.rabbitmq.com/amqp-0-9-1-quickref.html#basic.ack

Also see section "2.1.2.1 Message Life-cycle" in the 0.9.1 AMQP
specification for a more detailed description.

> * Any guide for transaction? for example, commit and rollback a transaction.

Transactions are discouraged, but see this for more details:
http://www.rabbitmq.com/semantics.html#tx
http://www.rabbitmq.com/amqp-0-9-1-quickref.html#class.tx

Publisher confirms are recommended instead of transactions:
http://www.rabbitmq.com/extensions.html#publishing



-Emile



More information about the rabbitmq-discuss mailing list