[rabbitmq-discuss] AlreadyClosedException in Java client

Matthias Radestock matthias at rabbitmq.com
Wed Nov 3 11:40:58 GMT 2010


Jiri,

On 03/11/10 11:27, jiri at krutil.com wrote:
> There are errors like this on the server, which might very well be related:
>
> =ERROR REPORT==== 3-Nov-2010::11:04:24 ===
> connection <0.17229.0> (running), channel 4 - error:
> {amqp_error,not_found,
> "no exchange 'foo' in vhost '/capacity/development'",
> 'basic.publish'}
>
> Is it possible that this is the actual problem

Yes.

> and the Java client is only reporting misleading error messages?

Publishing is asynchronous, which means basic.publish itself will never 
"return" any error that it may have triggered. Instead the error is 
handled asynchronously by the client library code. The 
AlreadyClosedException you are seeing is due to library having received 
and processed the server-initiated channel.close already by the time the 
application tries to close the channel.

Regards,

Matthias.


More information about the rabbitmq-discuss mailing list