[rabbitmq-discuss] How to tell Java Client running in a separate thread to stop consuming

dusura dusura at gmail.com
Thu Oct 20 07:52:48 BST 2011


Hi,

I would like to tell a Java Client to stop consuming. The client is
running in a separate thread. How can I do this?

I tried interrupting the thread but the RabbitMQ impl swallows
InterruptedException.

Any suggestions would be appreciated.

Cheers.

My thread looks like this:

"Thread-1" prio=6 tid=0x03766400 nid=0x738 in Object.wait()
[0x03f0f000]
   java.lang.Thread.State: WAITING (on object monitor)
	at java.lang.Object.wait(Native Method)
	at java.lang.Object.wait(Object.java:485)
	at com.rabbitmq.utility.BlockingCell.get(BlockingCell.java:50)
	- locked <0x22ce4fd8> (a
com.rabbitmq.utility.BlockingValueOrException)
	at
com.rabbitmq.utility.BlockingCell.uninterruptibleGet(BlockingCell.java:
89)
	- locked <0x22ce4fd8> (a
com.rabbitmq.utility.BlockingValueOrException)
	at
com.rabbitmq.utility.BlockingValueOrException.uninterruptibleGetValue(BlockingValueOrException.java:
33)
	at com.rabbitmq.client.impl.AMQChannel
$BlockingRpcContinuation.getReply(AMQChannel.java:337)
	at com.rabbitmq.client.impl.AMQChannel.privateRpc(AMQChannel.java:
210)
	at com.rabbitmq.client.impl.AMQChannel.exnWrappingRpc(AMQChannel.java:
128)
	at com.rabbitmq.client.impl.ChannelN.basicGet(ChannelN.java:808)
	at sun.reflect.GeneratedMethodAccessor8.invoke(Unknown Source)
	at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:
25)
	at java.lang.reflect.Method.invoke(Method.java:597)
..............



More information about the rabbitmq-discuss mailing list