[rabbitmq-discuss] After server notifies of canceled consume, it doesn't acknowledge a channel close

Steve Powell steve at rabbitmq.com
Wed May 1 10:07:32 BST 2013


Hi Chip,
If you are using the Java client, then it is possible that you are issuing the channel.close() from within the Consumer (in the code for the handleCancel() method).

In this case, the Consumer callback is being executed on a worker thread, and although you can issue channel commands from here, close() is a bit special, because it may involve waiting for callbacks to finish. This would explain why you hang in the client. (The server is probably sending the close-ok, but you aren't seeing it -- the client has hung already.)

We should document this properly in the Java client specs, but in the meantime, you should issue the close in the main app, rather than in the Consumer.

Does this explain your observed behaviour?

BTW: This is all speculation, and if I am off the mark, I apologise.  In reporting problems a little more context is helpful: which client you are using, more about how you are using it, and some diagnostic information [in this case, the stack frames during the hang, and/or a trace of the frames to/from Rabbit would have been perfect] can speed a satisfactory response.

Steve Powell  [Cell: +44-7815-838-558]
Links: Pivotal, SpringSource, VMware, Virgo, RabbitMQ.
-----------------------------------------------------------------------
Good design:
   is innovative, useful, aesthetic;
   is understandable, unobtrusive, honest;
   is long-lasting, thorough, environmentally friendly;
   and is as little design as possible.
Copyright Dieter Rams, amended March 2003; October 2009; and August 2012

On 1 May 2013, at 05:16, Chip Salzenberg <rev.chip at gmail.com> wrote:

> I've successfully used the optional server feature of sending a basic.cancel when a consumed queue is deleted.  Great.  But a reasonable thing to do at that point is to close the channel, right?  But when I send a channel.close in that circumstance, RMQ 3.0.4 does not send a close-ok.  It doesn't send anything.  This makes my app hang.  I have to cheat and ass_u_me that the channel is closed in order to keep working.
> 
> Am I doing something wrong?  Is this a server bug?  Both?  :)
> _______________________________________________
> rabbitmq-discuss mailing list
> rabbitmq-discuss at lists.rabbitmq.com
> 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/20130501/0e045b39/attachment.htm>


More information about the rabbitmq-discuss mailing list