[rabbitmq-discuss] Questions on consumerTags and basicConsume

Michael Klishin michael.s.klishin at gmail.com
Wed Jan 18 07:10:39 GMT 2012


Mark Petrovic:

> - Is a consumer tag a token that should be unique on a per call basis to Java basic.Consume()?  And what exactly is a consumer tag good for?  
> 

Consumer tag is a subscription identifier, applications use to cancel the subscription. AMQP clients use it to know what handler to use when messages are delivered.
It has to be unique in the vhost you are using. There are versions of basicConsume that will generate consumer tag for you.

> - I've seen some evidence that basic.Consume() does not block in the absence of messages to consume. Is that to be expected?

basicConsume registers a consumer that rabbitmq will push messages to as soon as they are available in the queue. It is "push API".
For "pull API" (fetching messages on demand), see basicGet.

MK



More information about the rabbitmq-discuss mailing list