[rabbitmq-discuss] How to stop consuming message from selective queue

Subshiri S subshiri at gmail.com
Mon Apr 28 10:07:16 BST 2014


Yes, I got it. the basicConsume() method returns the consumer tag 
corresponding to the queue. So I can call the basicCancel(consumertag) to 
unsubscribe from that queue alone.

String consumerTag1 = *channel*.basicConsume("queue1", consumer);

String consumerTag2= *channel*.basicConsume("queue3", consumer);

*channel*.basicCancel(consumerTag2);
Thank you.
Subshiri

On Monday, April 28, 2014 1:35:36 PM UTC+5:30, Alvaro Videla wrote:
>
> Hi, 
>
> Yes, you can use basicCancel for a specific consumer. See here: 
> https://www.rabbitmq.com/amqp-0-9-1-quickref.html 
>
> Regards, 
>
> Alvaro 
>
> On Mon, Apr 28, 2014 at 9:30 AM, Subshiri S <subs... at gmail.com<javascript:>> 
> wrote: 
> > 
> >> 
> >> QueueingConsumer consumer = new QueueingConsumer(channel); 
> >> channel.basicConsume("queue1", consumer); 
> >> channel.basicConsume("queue3", consumer); 
> > 
> > 
> > Is it possible to stop consuming the messages from the queue "queue3" 
> alone 
> > dynamically? 
> > 
> > _______________________________________________ 
> > rabbitmq-discuss mailing list 
> > rabbitmq... at lists.rabbitmq.com <javascript:> 
> > https://lists.rabbitmq.com/cgi-bin/mailman/listinfo/rabbitmq-discuss 
> > 
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20140428/ccd847ec/attachment.html>


More information about the rabbitmq-discuss mailing list