activemq-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Torsten Mielke <tors...@fusesource.com>
Subject Re: How to control thread creation in an embedded broker
Date Wed, 05 Oct 2011 13:41:21 GMT
What's the name of the threads being created continuously on your broker?
not using a dedicated task runner is a good idea, as it uses a thread pool instead. However
from what I know the size of that thread pool is basically unbounded as well, and if all newly
created threads are in use, the broker will just create more threads as needed.  

Can you reproduce the problem in an isolated JUnit test?


Torsten Mielke
torsten@fusesource.com
tmielke@blogspot.com

On Oct 5, 2011, at 1:16 PM, Millies, Sebastian wrote:

> Hello there,
> 
> I'm using an embedded BrokerService with a single destination,
> which is a queue that hands off incoming messages to an SCA
> logging service.
> 
> Internally, that logging service follows the producer-consumer pattern
> with a single blocking queue, so the producer basically gets handed a
> message from the broker and puts a log request on the queue.
> 
> The problem: as soon as the producer blocks, the broker starts
> creating thousands of threads, most of which will also block.
> until it runs out of memory. (I have already reduced the stack
> available to each thread with the -Xss option.)
> 
> How can I control thread creation in the broker (perhaps by supplying
> my own ThreadPoolExecutor with an upper bound on the maximum pool size)?
> 
> Here's how I create the broker. As you can see, I have already set
> the property "dedicatedTaskRunner" to false.
> 
> jmsBroker = new BrokerService();
> jmsBroker.setUseJmx( true );
> jmsBroker.setPersistent( false );
> // only relevant when using persistence
> jmsBroker.setDeleteAllMessagesOnStartup( true );
> jmsBroker.addConnector( "tcp://logginghost:61619" );
> jmsBroker.setDedicatedTaskRunner( false );
> jmsBroker.start();
> 
> -- Sebastian
> IDS Scheer Consulting GmbH
> Geschäftsführer/Managing Directors: Kamyar Niroumand, Ivo Totev
> Sitz/Registered office: Altenkesseler Straße 17, 66115 Saarbrücken, Germany - Registergericht/Commercial
register: Saarbrücken HRB 19681
> http://www.softwareag.com
> 






Mime
View raw message