basic.cancel vs channel.close

899 views
Skip to first unread message

Rac Lst

unread,
Jul 23, 2014, 3:45:02 PM7/23/14
to rabbitm...@googlegroups.com
Hello,

The doc (http://www.rabbitmq.com/amqp-0-9-1-quickref.html) says that basic.cancel will "end a queue consumer". But does channel.close do the same? For example, when I want to end a consumer and no longer need the channel, is there a reason to call basic.cancel followed by channel.close instead of just calling channel.close?

Thanks,

Rac

Simon MacMullen

unread,
Jul 23, 2014, 4:00:22 PM7/23/14
to Rac Lst, rabbitm...@googlegroups.com
On 23/07/2014 20:45, Rac Lst wrote:
> Hello,
>
> The doc (http://www.rabbitmq.com/amqp-0-9-1-quickref.html) says that
> basic.cancel will "end a queue consumer". But does channel.close do the
> same?

Well, channel.close does that and more.

> For example, when I want to end a consumer and no longer need the
> channel, is there a reason to call basic.cancel followed by
> channel.close instead of just calling channel.close?

No, you can just close the channel, it will take consumers with it.

Cheers, Simon
Reply all
Reply to author
Forward
0 new messages