camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Claus Ibsen <claus.ib...@gmail.com>
Subject Re: Thread pool for Camelcontext
Date Tue, 22 May 2012 11:40:08 GMT
On Tue, May 22, 2012 at 4:53 AM, dj5483 <dj5483@gmail.com> wrote:
> Claus,
> I too am implementing a Camel (2.9.1) project on WebSphere (7.0.0.19).
> After reading the Camel Docs it was clear to me that I was supposed to
> implement the ThreadPoolFactory interface and declare a Spring Bean to allow
> Camel to wire in my implementation.  After attempting to implement the
> ThreadPoolFactory on my own I began to look for help and found this user
> board.  The code that Preben has supplied turned out to be quite useful.  It
> seems to me though, that there is a gap in the Camel API.  The
> ThreadPoolFactory interface provides methods that operate on a
> ThreadFactory.  I believe the ThreadFactory is the appropriate place to tie
> into the CommonJ WorkManager, not the ThreadPoolFactory.  The
> DefaultExecutorServiceManager uses a private method to create new instances
> of a ThreadFactory (CamelThreadFactory).  It seems like the ThreadFactory
> should also be able to be injected.  This would allow us to easily override
> the mechanism that is creating the individual threads.  Is there something
> that I am missing with the ThreadPoolFactory?
>

Well the idea is really that you implement it *all* when you do custom
threading in WAS etc.
However if you want to extend the default impls in Camel, we can
possible turn private methods in protected etc.

As usual we love contributions.


>
> Claus Ibsen-2 wrote
>>
>> Hi
>>
>> You need to implement
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ThreadPoolFactory.html
>> and then configure camel to use your impl on the ExecutorServiceManager
>>
>> http://camel.apache.org/maven/current/camel-core/apidocs/org/apache/camel/spi/ExecutorServiceManager.html#setThreadPoolFactory(org.apache.camel.spi.ThreadPoolFactory)
>>
>> The latter can be auto detected by Camel if you in the Spring XML file
>> just define your custom thread pool factory.
>> As these bean types can do that:
>> http://camel.apache.org/advanced-configuration-of-camelcontext-using-spring.html
>>
>> On Tue, Feb 21, 2012 at 3:11 AM, achalam &lt;aadi.chalam@&gt; wrote:
>>> Hi,
>>> We are using camel 2.9 with Springframework3.0.4 and Websphere 7.1 . How
>>> do
>>> we configure, the camel, so that we use the managed threads in the
>>> application. I know the configuration in spring, to use the workmanager,
>>> but
>>> somehow, not able to understand how it is done in the context of camel.
>>>
>>> Thanks,
>>> Adi
>>>
>>> --
>>> View this message in context:
>>> http://camel.465427.n5.nabble.com/Thread-pool-for-Camelcontext-tp470625p5500895.html
>>> Sent from the Camel - Users mailing list archive at Nabble.com.
>>
>>
>>
>> --
>> Claus Ibsen
>> -----------------
>> FuseSource
>> Email: cibsen@
>> Web: http://fusesource.com
>> Twitter: davsclaus, fusenews
>> Blog: http://davsclaus.blogspot.com/
>> Author of Camel in Action: http://www.manning.com/ibsen/
>>
>
> --
> View this message in context: http://camel.465427.n5.nabble.com/Thread-pool-for-Camelcontext-tp470625p5713248.html
> Sent from the Camel - Users mailing list archive at Nabble.com.



-- 
Claus Ibsen
-----------------
CamelOne 2012 Conference, May 15-16, 2012: http://camelone.com
FuseSource
Email: cibsen@fusesource.com
Web: http://fusesource.com
Twitter: davsclaus, fusenews
Blog: http://davsclaus.blogspot.com/
Author of Camel in Action: http://www.manning.com/ibsen/

Mime
View raw message