You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by Stefan Below <st...@gmx.de> on 2011/03/30 18:14:23 UTC
unique ExecuterService for each CamelContext
Hi,
I am running multiple Camel instances in the same JVM. Each Camel
instance should have an unique, custom Executerservice. I set the
Executerservice to the CamelContext registry.
But when i start the same route in two different contexts, the
executerservice gets shared.... (Same issue with a custom splitter)
How can i avoid this?
Thanks,
Stefan
Re: unique ExecuterService for each CamelContext
Posted by Claus Ibsen <cl...@gmail.com>.
If you provide a custom executor service using executorServiceRef
thats a reference to X.
And Camel just uses X as given by the container (usually Spring bean container).
So if you configure Spring to use prototype scope then Spring will
create a new X. If not it will create a shared X.
In Camel you can use ThreadPoolProfiles to setup thread pool settings,
which will be used as a "template" to create thread pools when needed.
So that allows you to easily setup pool boundaries and have each
splitter create their own thread pool instance based on the profile.
Read the documentation
http://camel.apache.org/threading-model.html
On Thu, Mar 31, 2011 at 9:37 AM, Stefan Below <st...@gmx.de> wrote:
> Hello,
>
> i've found a workaround.
> It looks like that the instance of the ExecutorService and Splitter are
> stored in the model (RouteDefinition).
> So everything works fine if i create a new instance of the RouteDefinition.
> But i think it should be fixed for consistency (Aggregator and
> AggregatorRepository are not stored in the model)
>>
>> Hi,
>> I am running multiple Camel instances in the same JVM. Each Camel instance
>> should have an unique, custom Executerservice. I set the Executerservice to
>> the CamelContext registry.
>> But when i start the same route in two different contexts, the
>> executerservice gets shared.... (Same issue with a custom splitter)
>>
>> How can i avoid this?
>>
>> Thanks,
>> Stefan
>>
>
>
--
Claus Ibsen
-----------------
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/
Re: unique ExecuterService for each CamelContext
Posted by Stefan Below <st...@gmx.de>.
Hello,
i've found a workaround.
It looks like that the instance of the ExecutorService and Splitter are
stored in the model (RouteDefinition).
So everything works fine if i create a new instance of the
RouteDefinition. But i think it should be fixed for consistency
(Aggregator and AggregatorRepository are not stored in the model)
> Hi,
> I am running multiple Camel instances in the same JVM. Each Camel
> instance should have an unique, custom Executerservice. I set the
> Executerservice to the CamelContext registry.
> But when i start the same route in two different contexts, the
> executerservice gets shared.... (Same issue with a custom splitter)
>
> How can i avoid this?
>
> Thanks,
> Stefan
>