On 3/8/07, rabidgremlin <[EMAIL PROTECTED]> wrote:
After digging around I found this link:

http://activemq.apache.org/slow-consumer-handling.html

Since I don't mind if I lose messages (they have a 30 sec lifespan anyway)
it looks like I could set up a ConstantPendingMessageLimitStrategy to throw
away messagse so I don't block.

Should this work ?

Yes. The only other thing you might wanna do is set a low prefetch
value to avoid keeping too many messages around...
http://activemq.apache.org/what-is-the-prefetch-limit-for.html

This page is worth a read too
http://activemq.apache.org/my-producer-blocks.html



I tried the following bit of code but it did not seem to make any difference
(I suspect it is not correct):

  broker = new BrokerService();

  // no JMX or persistence needed
  broker.setUseJmx(false);
  broker.setPersistent(false);

  ConstantPendingMessageLimitStrategy strat = new
ConstantPendingMessageLimitStrategy();
  strat.setLimit(50);

  PolicyEntry polEntry = new PolicyEntry();
  polEntry.setPendingMessageLimitStrategy(strat);

  PolicyMap policyMap = new PolicyMap();
  policyMap.setDefaultEntry(polEntry);

  broker.setDestinationPolicy(policyMap);

The above looks good to me. Try the prefetch setting & usageManager
tweaks mentioned in the 2 pages I gave and retest

--

James
-------
http://radio.weblogs.com/0112098/

Reply via email to