[rabbitmq-discuss] RabbitMQ RPC in Tomcat container

steven.willems at i-develop.be steven.willems at i-develop.be
Wed Jul 24 16:08:32 BST 2013

I'm trying to setup RabbitMQ RPC in a web project (like suggested in tutorial 
6 <http://www.rabbitmq.com/tutorials/tutorial-six-java.html>). It works as 
intended, but when I try to shutdown Tomcat, the shutdown hangs as soon as 
I have created a consumer listening to the rpc response. 

jstack and some debugging learned me that for each created consumer, a 
thread is created. And those threads are preventing Tomcat from shutting 
down (as they are not managed by Tomcat).

Looking at ConsumerWorkService, there is a method addWork, which creates a 
new WorkPoolRunnable and if I have understood it correctly, those 
Runnable's are only stopped when the 'key', being the channel is stopped.

I find that a bit odd.. I would expect that when I call stub.channel.basicCancel(consumer.getConsumerTag()); 
the runnable for the consumer is removed. 

Or am I completely wrong about my findings and is something else going on?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130724/061b2689/attachment.htm>

More information about the rabbitmq-discuss mailing list