Re: Using ExecutorService from JEE server
Zoran, thanks for the great answer.
I got it working by implementing a proof-of-concept ExecutorServiceManager
and delegating all the methods that return either ExecutorService of
Thinking about how this should look in production…
1. get/set ThreadPoolFactory: I assume I can return null/ignore,,, won't
2. Same for methods that use ThreadPoolProfile (assuming I will configure
in Liberty): I can ignore/return nulls
3. Then, there's the shutdown/graceful-shutdown methods. Would it make
more sense to try extending the DefaultExecutorServiceManager, and override
On Fri, May 4, 2018 at 3:52 AM Zoran Regvart <zoran@xxxxxxxxxxx> wrote:
> Hi Darius,
> you need to implement ExecutorServiceManager interface and delegate
> to ExecutorService you looked up in Liberty and set that
> implementation on CamelContext via setExecutorServiceManager
> method. If you're using Camel Spring XML support and
> ExecutorServiceManager is available in the Spring application context
> it will be picked up automatically.
> This does not happen if you're using Camel support for Spring Boot
> auto configuration. I've created CAMEL-12482 to make this on par in
> Spring Boot support.
> As a workaround you can invoke CamelContext::setExecutorServiceManager
> as a part of your initialization. Also make note that certain
> components use their own thread pools and will need additional
> configuration depending on the component.
> On Fri, May 4, 2018 at 5:27 AM, Darius Cooper <dariuscooper@xxxxxxxxx>
> > The Camel In Action book says: "When you need to use a different thread
> > pool provider (for example, a provider from a Java EE server), you can
> > create a custom ExecutorServiceManager to work with the provider. "
> > On IBM Liberty, by turning on the feature "concurrent/1.0" one can get an
> > ExecutorService. I would like to use this ExecutorService.
> > My understanding is that I can create a ThreadPoolFacotory that wraps
> > ExecutorService.
> > As long as that ThreadPoolFactory is a Spring bean, Camel will find it
> > use it as the default.
> > Is that correct? It does not appear to use the ExecutorService from
> > Liberty. Does does it have to be set explicitly on the Camel context?
>  https://issues.apache.org/jira/browse/CAMEL-12482
> Zoran Regvart