[rabbitmq-discuss] java client swallows interrupts

Matthew Sackman matthew at lshift.net
Fri Apr 2 16:11:39 BST 2010


Hi Anton,

Sorry for the slow reply.

On Thu, Mar 18, 2010 at 01:58:13PM +0300, mabrek wrote:
> I came across java client issue: it clears thread interrupted status
> and/or swallows InterruptedException in Channel operations (close,
> basicPublish) and Connection.close, maybe in others.
> It creates a problem when I need to stop consumer thread pool by
> issuing ExecutorService.shutdownNow, they won't stop.

Yup, I think this is the catch in the quiescingTransmit method in
com/rabbitmq/client/impl/AMQChannel.java

Of course, I'd actually recommend that you shutdown by closing the
consumers, channels and connections down explicitly rather than just
trying to kill off the threads. The Javadoc for shutdownNow does say:
"There are no guarantees beyond best-effort attempts to stop processing
actively executing tasks"

Is there a reason why you can't more gracefully shutdown the threads?

Matthew




More information about the rabbitmq-discuss mailing list