[rabbitmq-discuss] The idiom for shutting down a consumer in a thread task

Michael Klishin michael.s.klishin at gmail.com
Mon Jan 16 15:31:04 GMT 2012


Mark Petrovic:

> what is the recommended way to cancel this logical task?  Call
> connection.close() and exit out the catch-block?

Closing the entire connection is probably not necessary. Closing the channel is sufficient. Another way is to store consumer tag basicConsume returns you and use basicCancel to cancel it later.

MK



More information about the rabbitmq-discuss mailing list