[rabbitmq-discuss] RabbitMQ RPC in Tomcat container
mklishin at gopivotal.com
Thu Jul 25 05:30:14 BST 2013
steven.willems at i-develop.be:
> 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?
You are right, RabbitMQ Java client does start new threads (which in theory apps deployed
to app containers should not do):
* Network activity loop (one per connection)
* Consumer work pool (one per channel)
Work pools cannot be cancelled after basicCancel because there can be more than
one consumer on the channel.
Some clients  solve this by tracking how many consumers are registered on the
channel and when the last one is gone, shut down any threads that were created
to handle deliveries.
It may be a good idea for to the Java client to do the same. In the meantime, closing
channels and then connection on shutdown should help.
-------------- next part --------------
A non-text attachment was scrubbed...
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
More information about the rabbitmq-discuss