I'm encountering a deadlock related to throttling (producer flow control).
Here is the scenario which causes this. I receive a message from a queue,
process this message, and send a message to a different queue inside the
message handler. When throttling kicks in, this results in a deadlock. The
new message send blocks when throttling has kicked in, and it is waiting for
a message to be dequeued. But the original message sent does not seem to be
marked as being dequeued by the throttler until after I exit from the
message handler (which is blocked). Hence I'm deadlocked.

I can avoid the deadlock by using a separate thread to send the new message.
I can also avoid the deadlock by using async sends. Both have downsides,
however. Using a separate thread will require some logic wrapping every
message send. Using async sends bypasses throttling altogether (not what I
want), and has other consequences.

Is using async sends with connctionFactory.setProducerWindowSize() the
correct approach to prevent throttling from deadlocking? I don't really want
to use async sends other than to avoid this problem. Or is there a way to
indicate to the throttler to unblock immediately after a receive() call?


--
View this message in context: 
http://activemq.2283324.n4.nabble.com/Throttling-deadlock-tp4124447p4124447.html
Sent from the ActiveMQ - User mailing list archive at Nabble.com.

Reply via email to