camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Babak Vahdat <babak.vah...@swissonline.ch>
Subject Re: Threading Model in Camel
Date Mon, 23 Jan 2012 15:05:44 GMT


Am 23.01.12 14:56 schrieb "thestubborncamel" unter
<ramaraghavan@gmail.com>:

>Thanks for that clarification again. that helps a lot.
>
>Extending this discussion a bit -
>
>If I were to generalize it, the ³consumer² thread at the appropriate
>from-endpoint-transport is what is used to complete the route
>execution.
>
>i.e. if incoming requests is a http(jetty server) endpoint, route
>execution is done on the consumer threads managed by jetty. (and you
>would have to configure those thread pools in
>'org.eclipse.jetty.util.thread.ThreadPool' and not through the managed
>thread pools that Camel creates.)

Right!

>
>Likewise, for JMS transport, the route is completed on the consumer
>thread of the JMS consumer. The concurrency or thread pool for JMS
>from-endpoint is configured using  jms:MyQueue?concurrentConsumers=NN.

Also in case of JMS concurrentConsumers it's similar to Jetty as well,
that's this option is delegated to Spring JMS
DefaultMessageListenerContainer which creates it's *own* worker threads
for that option. So that Camel's managed thread pool(s) doesn't effect
anything here at all.

>
>So - then - seems like any camel managed thread pools are used
>primarily for parallel processing of beans or async handling within
>the camel route.

Yes, like the SEDA component making use of the Camel's managed thread
pools which is simply leveraging of the JDK concurrency API.

>
>Woud that be a fair statement? any corrections or further thoughts?

And you can also hook in your custom ThreadPoolFactory [1] in case you
intend not
to make use of the leveraged JDK concurrency API. For example in a JEE
setup an implementation of yours could make use of the WorkerManager [2]
API.

[1] 
http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring
.html
[2] 
http://docs.oracle.com/javaee/6/api/javax/resource/spi/work/WorkManager.htm
l


>
>On 1/22/12, Babak Vahdat [via Camel]
><ml-node+s465427n5163797h65@n5.nabble.com> wrote:
>>
>>
>> Yes!
>>
>> The processing of the incoming requests by Jetty are done inside threads
>> managed by the thread pools of the type
>> 'org.eclipse.jetty.util.thread.ThreadPool' and not through the managed
>> thread pools that Camel creates.
>>
>> Babak
>>
>> _______________________________________________
>> If you reply to this email, your message will be added to the discussion
>> below:
>> 
>>http://camel.465427.n5.nabble.com/Threading-Model-in-Camel-tp5163081p5163
>>797.html
>>
>> To unsubscribe from Threading Model in Camel, visit
>> 
>>http://camel.465427.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscr
>>ibe_by_code&node=5163081&code=cmFtYXJhZ2hhdmFuQGdtYWlsLmNvbXw1MTYzMDgxfC0
>>xNTUxNzMzMDM0
>
>
>-- 
>Rama Raghavan
>Mobile: (972) 273-9875
>
>
>--
>View this message in context:
>http://camel.465427.n5.nabble.com/Threading-Model-in-Camel-tp5163081p51661
>27.html
>Sent from the Camel - Users mailing list archive at Nabble.com.



Mime
View raw message