[rabbitmq-discuss] Questions on consumerTags and basicConsume
Mark Petrovic
mspetrovic at gmail.com
Thu Jan 19 02:08:07 GMT 2012
Thank you for the kind response.
I realize and understand now that
channel.basicConsume()
is called once per desired consumer registration. In that sense I
wish the method were called something like
channel.registerConsumer()
which would have kept me from thinking that I need to call
basicConsume() more than once.
But, I got it now. Thanks.
On Tue, Jan 17, 2012 at 11:10 PM, Michael Klishin
<michael.s.klishin at gmail.com> wrote:
> 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
>
--
Mark
More information about the rabbitmq-discuss
mailing list