Filip Hanik - Dev Lists wrote:
Rob Davies wrote:

On 1 May 2008, at 00:02, Filip Hanik - Dev Lists wrote:

There doesnt seem to be a way of limiting how messages are delivered to the client. the ActiveMQMessageConsumer.unconsumedMessages seems to fill up, all to quickly, and eventually cause an OOME

we have this setting on the server
<destinationPolicy>      <policyMap>
      <policyEntries>
<policyEntry topic=">" producerFlowControl="false" memoryLimit="10mb"> <deadLetterStrategy> <sharedDeadLetterStrategy processExpired="false" processNonPersistent="false" /> </deadLetterStrategy>
          <!--  10 seconds worth -->
<!-- lets force old messages to be discarded for slow consumers -->
          <pendingMessageLimitStrategy>
            <constantPendingMessageLimitStrategy limit="1000"/>
          </pendingMessageLimitStrategy>
        </policyEntry>              </policyEntries>
    </policyMap>
  </destinationPolicy>


is there another setting to protect against this kind of OOME

Filip

Hi Filip,

You can override how many messages are delivered to a consumer by setting its prefetch limit - see the FAQ entry - http://activemq.apache.org/what-is-the-prefetch-limit-for.html
hi Rob, yes I have that setting
uri="tcp://127.0.0.1:61616?jms.prefetchPolicy.all=10&amp;wireFormat.maxInactivityDuration=0&amp;jms.redeliveryPolicy.maximumRedeliveries=-1"

it's still downloading tons of messages to the client, I had to patch the code itself

in ActiveMQMessageConsumer.java I did
 synchronized (unconsumedMessages.getMutex()) {
   if (unconsumedMessages.size()>MAX_UNCONSUMED_MSGS) {
     Object o = unconsumedMessages.dequeueNoWait();
       if (LOG.isDebugEnabled()) {
LOG.debug("Unconsumed message size too large, removing oldest message:"+o);
       }
     }
     unconsumedMessages.enqueue(md);
 }


this way I could drop messages on the client, but I was hoping there was a server side config
even client side code for prefetch doesn't take into effect

           ActiveMQPrefetchPolicy pp = new ActiveMQPrefetchPolicy();
           pp.setAll(10);
           connectionFactory.setPrefetchPolicy(pp);

and the system still OOME with unconsumedMessages being the cause of the problem

activeMQ 5.0.0

Filip

Filip




cheers,

Rob

http://open.iona.com/ -Enterprise Open Integration
http://rajdavies.blogspot.com/







Reply via email to