[rabbitmq-discuss] Java client: Closing channel in channel shutdown listener

jiri at krutil.com jiri at krutil.com
Wed Nov 3 14:19:49 GMT 2010


Using the Java client, I have a shutdown listener registered on a  
channel. When this listener gets invoked, I attempt to close all AMQP  
resources. This includes closing other channels.

When I attempt to close another channel inside the channel shutdown  
listener, the connection thread seems to hang. The call stack looks  
like this:

	BlockingValueOrException<V,E>.uninterruptibleGetValue(int) line: 51
	AMQChannel$SimpleBlockingRpcContinuation(AMQChannel$BlockingRpcContinuation<T>).getReply(int) line:  
348
	ChannelN.close(int, String, boolean, Throwable, boolean) line: 416
	ChannelN.close(int, String) line: 360
	ChannelN.close() line: 353
	MyClass.shutdownCompleted(ShutdownSignalException) line: 40
	ChannelN(ShutdownNotifierComponent).notifyListeners() line: 74
	ChannelN.processAsync(Command) line: 242
	ChannelN(AMQChannel).handleCompleteInboundCommand(AMQCommand) line: 165
	ChannelN(AMQChannel).handleFrame(Frame) line: 110
	AMQConnection$MainLoop.run() line: 434

Both broker and Java client are 2.1.0.

Am I doing something I shouldn't?

Cheers
Jiri



More information about the rabbitmq-discuss mailing list