camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ShlomiJ <>
Subject Re: WireTap threads number keeps on growing
Date Tue, 13 Mar 2012 08:13:12 GMT
OK, I'm a bit more knowledgeable now...

The first issue is that I thought I created a pool of 1 thread.

ShlomiJ wrote
> ThreadPoolBuilder tpBuilder = new ThreadPoolBuilder(this.context); 
> ExecutorService wiretapThreadpool =
> tpBuilder.poolSize(*1*).maxPoolSize(*1*).maxQueueSize(*1*).build("WireTap"); 
> registry.put(WIRETAP_THREADPOOL, wiretapThreadpool);
But I did not. The pool created was actually of 10 threads.
So once 10 messages passed in the route, all 10 threads have been created
and reused.

Another issue is the number of calls to wireTap and the way the pool is

ShlomiJ wrote
> from("quartz://myScheduler?cron=0+*+*+*+*+?") 
> .process(new MyMessageSetterProcessor()) 
> .wireTap("seda:wireTapQueue").onPrepare(new
> MyCloneProcessor()).*executorServiceRef*(WIRETAP_THREADPOOL) 
> .log("${body}")
I now understand that each route has its own pool. So I have (10 *
#schedules) threads of wiretap.

*But the real issue is that the wiretap threads (maybe others also?) are not
removed when the route is removed.*
I remove a route with CamelContext.getRoute(String) ->
CamelContext.stopRoute(String) -> CamelContext.removeRoute(String).
The last method returns true, but the wiretap threads are still alive.

I'm using Camel 2.9.0.

View this message in context:
Sent from the Camel - Users mailing list archive at

View raw message