activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From TonyLeigh <>
Subject Consumer blocking when session created on same connection as blocked producer
Date Mon, 26 Feb 2007 17:48:23 GMT

Hello All,

I've been struggling with a problem of ActiveMQ locking up with a
combination of fast producers and slow consumers.  After trawling through
the threads I think I understand what is happening and why the lockup
occurs, but I can only solve the lockup with two connections when it seems
that one should work.  

The situation is that I have a 
 making large requests as a fast producer and a  acting as a slow

If you run the examples with a standard broker configuration the broker will
lock up due to lack of memory as the consumer in the sender cannot consume
messages as it needs to produce a reply inorder to send an ack.  If you
change the broker config to limit the memory per queue:

          <policyEntry queue="TEST.>" memoryLimit="20000"/>
          <policyEntry queue="TEST.SERVER.IN" memoryLimit="10000"/>

Then the broker does not lock up and the server is able to produce messages
to the client input queue.

The problem is that the consumer in the client will block and not receive
messages from the client queue if the consumer (and session) were created
from the same connection as the producer.  If a separate connection is used
then the client consumer will always consumer messages and the system does
not lock.

Why do I need a separate connection for the client consumer?  According to
the JMS spec a session should create a separate thread for message
consumption so the client should not block on consumption even if message
production is blocked.



View this message in context:
Sent from the ActiveMQ - User mailing list archive at

View raw message