Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In Java DSL you can configure the default thread pool profile from the ExecutorServiceStartegy ExecutorServiceStrategy/ExecutorServiceManager which you access from CamelContext.

...

All the thread pools that Camel creates are managed and thus you can see them in JConsole under the threadpools category.

ExecutorServiceStrategy

...

Available as of Camel 2.3 to 2.

...

8.

...

x
Camel provides a pluggable strategy to hook in your own thread pool provider, for example from a WorkManager in a J2EE server etc.
See the org.apache.camel.spi.ExecutorServiceStrategy interface which you should implement and hook into the WorkManager.

...

You can configure it on the CamelContext from Java DSL using the getter/setter.

ExecutorServiceManager

...

Available as of Camel 2.9

...

In camel 2.9.0 the ExecutorServiceManager replaces the ExecutorServiceStrategy. It is renamed to manager as is not only provides a strategy for threadPool thread pool creation but also keeps track of thread pools and thread pool profiles. It has methods to register thread pool profiles and to create and shutdown ExecutorService and ScheduledExecutorService instances. The ThreadPoolBuilder class helps to create ThreadPoolProfiles in Java.

To hook in custom thread pool providers (e.g. for J2EE servers) a ThreadPoolFactory interface can be implemented. The implementation can be set in the ExecutorServiceManager. The Factory interface is much simpler then the former Strategy ExecutorServiceStrategy and makes the job of integrators much easier.

...

On the ExecutorServiceStrategy/ExecutorServiceManager you can configure the thread name pattern using the setThreadNamePattern method, which defines the thread names used when a thread pool creates a thread.

...

If you develop your own Camel component and are in need of a thread pool, then its advised to use the ExecutorServiceStrategy/ExecutorServiceManager to create the thread pool you need.

...