You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by rw83 <ra...@yahoo.com> on 2016/10/18 14:46:27 UTC
CamelBlueprintTestSupport errors out when the blueprint has a
custom threadpool
Sample of my blueprint is attached here.
<camelContext id="myCamelContext"
useMDCLogging="true" threadNamePattern="#counter#"
trace="false" xmlns="http://camel.apache.org/schema/blueprint">
<threadPool id="threadPoolExecutor" threadName="test"/>
<route id="myRoute">
<from uri="direct-vm:testIn" />
<setBody>
<simple>Scheduler</simple>
</setBody>
<to uri="direct-vm:testOut" />
</route>
</camelContext>
I am trying to load this blueprint file from my test case which extends
CamelBluePrintTest.
@Override
protected String getBlueprintDescriptor() {
return "my-blueprint.xml";
}
The problem is when my blueprint has a custom threadpool defined as above,
the container is unable to start this bundle. I don't see any descriptive
error other than below message.
16/10/18 09:56:46 ERROR container.BlueprintContainerImpl: Unable to start
blueprint container for bundle MyBundle/1.0.0
But If I commented out the threadPool definition, then it works as a charm.
Any Idea why this happens and how to fix this. I am using Camel 2.16.2
--
View this message in context: http://camel.465427.n5.nabble.com/CamelBlueprintTestSupport-errors-out-when-the-blueprint-has-a-custom-threadpool-tp5788903.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: CamelBlueprintTestSupport errors out when the blueprint has a
custom threadpool
Posted by rw83 <ra...@yahoo.com>.
I figured it out finally. The way I did was I created a thread pool executor
and added it as a service.
ThreadPoolBuilder builder = new ThreadPoolBuilder(context);
ExecutorService myPool = builder.build("threadPoolExecutor");
context.addService(myPool);
This fixed my issue.
--
View this message in context: http://camel.465427.n5.nabble.com/CamelBlueprintTestSupport-errors-out-when-the-blueprint-has-a-custom-threadpool-tp5788903p5789185.html
Sent from the Camel - Users mailing list archive at Nabble.com.