[rabbitmq-discuss] RabbitMQ RPC in Tomcat container

Michael Klishin 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 [1] 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.

1. http://rubybunny.info

-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 495 bytes
Desc: Message signed with OpenPGP using GPGMail
URL: <http://lists.rabbitmq.com/pipermail/rabbitmq-discuss/attachments/20130725/295208a5/attachment.pgp>

More information about the rabbitmq-discuss mailing list