Hello,

in our application we stop routes after execution and start them again with 
controlbus. During runtime, the thread count increases continuously with each 
invocation.
We have some consumer routes (ftp, jcifs, file) which should be event based 
activated and deactivated after batch consuming. Stop is the last step (to

Startprocess invoked from message driven bean in jboss: 
template = context.getProducerTemplate();
template.sendBody("direct:start", myRoute);

Startroute: 
from("direct:start")
   .setHeader(HEADER_CONTROL_ROUTE, "controlbus:route?routeId=" + getRouteId() 
+ "&action=start&async=true")
   .routingSlip().header(HEADER_CONTROL_ROUTE)
   .end();

Stoproute:
from("direct:stop")
   .setHeader(HEADER_CONTROL_ROUTE, "controlbus:route?routeId=" + getRouteId() 
+ "&action=stop&async=true")   
   .routingSlip().header(HEADER_CONTROL_ROUTE)
   .end()

Exampleroute: 
From("file://D:data?consumer.bridgeErrorHandler=true&delay=2147483647&eagerMaxMessagesPerPoll=false&idempotent=false&maxMessagesPerPoll=500&noop=true&sendEmptyMessageWhenIdle=true&sortBy=file%3Amodified&useFixedDelay=false
 ")
  .routeId(getRouteId())
  .autoStartup(false)
  .streamCaching().log(LoggingLevel.TRACE, "BODY: ${body}")
  .shutdownRunningTask(ShutdownRunningTask.CompleteAllTasks)
   .threads(1)
   .process(myEJB).
  .aggregate(property(PROPERTY), new MyAggregationStrategy())
  .completionFromBatchConsumer()
  .oncompletion().to("direct:stop");

After each invocation and of startprocess some new threads are created and in 
WAIT state:
Camel (camel-1) thread #11 - ControlBus 
Camel (camel-1) thread #12 - file://D:/data
Camel (camel-1) thread #13 - OnCompletion
Camel (camel-1) thread #14 - ControlBus

My assumption is, that threads are reused or stopped after stopping the route.
Any ideas what is going wrong? We are using camel-2.11.2 and verified this 
behavior with 2.12.0

Thanks for any advice
Robin

Reply via email to