blob: 46a92a4a09916d9e085c464e4e8d2a8b055cd32a [file] [log] [blame]
<div class="wiki-content maincontent"><h2 id="Myproducerblocks-WhatcanIdoifmyproducerblockssendingamessage?">What can I do if my producer blocks sending a message?</h2>
<p>This relates to <a shape="rect" href="producer-flow-control.html">Producer Flow Control</a>.</p>
<h3 id="Myproducerblocks-Active4.x">Active 4.x</h3>
<p>In ActiveMQ 4.x, all in transit messages are held in memory. If you have a slow consumer, to avoid exausting the JVM memory and getting an out of memory error, ActiveMQ has a configurable limit of how many in transit messages it will hold. Once it is reached, producers will be slowed down / blocked.</p>
<p>A quick fix is just to bump up the setting in your <strong>usageManager</strong> in your <a shape="rect" href="xml-configuration.html">Xml Configuration</a>. The default that ships with ActiveMQ is pretty low, only 20Mb of RAM, so try setting it to something large, say 512Mb.</p>
<p>An alternative approach is to set individual usageManager limits on different destinations and for producers versus consumers.</p>
<p>You might also want to use the <a shape="rect" href="jmx.html">JMX</a> support or <a shape="rect" href="web-console.html">Web Console</a> to look at what destinations are being used and what producers &amp; consumers you have to see whats going on.</p>
<h3 id="Myproducerblocks-Active5.xandLater">Active 5.x and Later</h3>
<p>As of 5.x of ActiveMQ there is support for <a shape="rect" href="message-cursors.html">Message Cursors</a> which by default move messages out of memory and onto disk. So this problem will not be seen unless you fill up the max allocated disk space for message storage which typically is an order of magnitude larger.</p>
<h3 id="Myproducerblocks-SeeAlso">See Also</h3>
<ul><li><a shape="rect" href="producer-flow-control.html">Producer Flow Control</a></li><li><a shape="rect" href="message-cursors.html">Message Cursors</a></li></ul></div>