Discussion:
Setting a default ExecutorService for all processors
T Rehman
2018-08-26 23:09:32 UTC
Permalink
Is it possible for all Camel processors to use the same default
ExecutorService?

To elaborate, I would like my Camel processors by default to use the same
ExecutorService that my Spring context uses. In my Spring context, I've set
a ThreadPoolTaskExecutor instance that all @Async-annotated Spring methods
will use. I've also made that instance available as an ExecutorService in
my Spring context. I would like my Splitter to use that same
ExecutorService by default when parallelProcessing is set to true on the
processor.

I know that I can manually point the Splitter to the ExecutorService by
setting the "executorServiceRef" property. I will do this as a fallback if
I'm unable to set a default.

I've looked into the ExecutorServiceManager - but it only seems possible to
set a default Thread profile on this manager, which I think will result in
a a new ExecutorService each time (but using the same default settings such
as pool size).

Help is appreciated.

Loading...