[rabbitmq-discuss] Problems Closing Channels

Matthias Radestock matthias at lshift.net
Tue Sep 16 08:44:48 BST 2008


Kyle,

Kyle Sampson wrote:
> Hello, I'm using the Java RabbitMQ client 1.4.0.  I've noticed that  
> there are occasions where calling Channel.close() causes the thread  
> the block indefinitely.  Most often this occurs when it's trying to  
> close a channel that has already been closed.

Channel.close() is waiting for the server to respond with AMQP's 
channel.close-ok reply, and by default it will wait indefinitely for 
that reply to arrive. It certainly shouldn't wait when the channel has 
been closed already though...

> However, recently I've run into a situation where calling this method
> will halt the thread even after a call to Channel.isOpen() returns
> true; no other threads are closing the channel or the connection.

Could it be that the server is closing the channel or connection? Even 
so, Channel.close() should return at that point.

We have recently fixed a few bugs in this area of the client code, and 
also extended the API to allow you to specify timeouts when closing a 
channel or connection, and to optionally ignore the case when the 
connection or channel are closed already.

So, if you can, please give the latest version of the Java client from 
our mercurial repository a try:
   hg clone http://hg.rabbitmq.com/rabbitmq-java-client/
or download a zip/tar.gz/bz2 from
 
http://hg.rabbitmq.com/rabbitmq-erlang-client/archive/tip.{zip,tar.gz,bz2}


Matthias.




More information about the rabbitmq-discuss mailing list