ThreadPoolFactory Vert.x
Since Camel 3.5
The camel-threadpoolfactory-vertx is a VertX based implementation of the ThreadPoolFactory
SPI.
By default Camel will use its own thread pool for EIPs that can use parallel processing (such as splitter, aggregator). You can plugin different engines via a SPI interface. This is a VertX based plugin that uses the VertX worker thread pool (executeBlocking).
Restrictions
This implementation has been designed to use VertX worker threads for EIPs where concurrency has been enabled (using default settings). However this is limited to only apply when the EIP are not configured with a specific thread pool. For example the first example below will use VertX worker threads, and the 2nd below will not:
from("direct:start")
.to("log:foo")
.split(body()).parallelProcessing()
.to("mock:split")
.end()
.to("mock:result");
The following Split EIP will refer to a custom thread pool, and therefore VertX is not in use, and Camel will use the custom thread pool:
// register a custom thread pool profile with id myLowPool
context.getExecutorServiceManager().registerThreadPoolProfile(
new ThreadPoolProfileBuilder("myLowPool").poolSize(2).maxPoolSize(10).build()
);
from("direct:start")
.to("log:foo")
.split(body()).executorServiceRef("myLowPool")
.to("mock:split")
.end()
.to("mock:result");