activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Vinod Venkatraman <>
Subject JMS transaction deadlocks producer
Date Wed, 16 Apr 2008 13:21:18 GMT

Hi All,

I am using AMQ 4.1.1 but this issue can also be seen in 5.0

If a producer chooses to participate in a JMS transaction we found that AMQ
will store all the messages in memory till producer calls commit (even if
JMS_DELIVERY_MODE of each message is PERSISTENT and broker has persistence
enabled) . 

So if we keep producing messages and the queue fills up before we commit
then producer will run into a deadlock. Broker won't allow to produce more
messages (as queue is full) and we won't call commit till we complete
production (produce more). 

So if we want to produce a large number of messages in a JMS transaction
(which might fill up the queue) we need to call commit in smaller batches
(say after every 50 messages) but then this defeats the purpose of JMS

For message size of 100KB a default AMQ queue was filling up within 300
messages (using JMX console we can see queue memory consumption to be 100%
and we cannot produce any further). 

Is this behaviour expected ?

Also how is a producer to know when the queue is nearly full so that it can
call commit.

Attached is a producer app which gets deadlocked after producing around 300
messages in both AMQ 4.1.1 and 5.0.

java JMSAttributeProducer --msg-size=102400 --broker-url=tcp://dharti:61616
--max-produce-cnt=1000 --persistent=true --transacted=true amq1.xml 

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

View raw message