...
The ExecutorServiceManager
has APIs for shutting down thread pools graceful and aggressively. Its encourage to use this API for creating and shutting down thread pools.
From Camel 2.10.211 onwards Camel the graceful shutdownGraceful(executorService)
method from ExecutorServiceManager
will shutdown graceful at first, until a timeout value is hit. After that it shutdown aggressively, again using the timeout value to wait for the operation to complete. This means you can wait at most 2 x timeout for shutting down the thread pool.
The timeout value is by default 10000
millis. You can configure a custom value on the ExecutorServiceManager
if needed. During shutdown Camel will log every 2nd second at INFO level progress of shutting down the thread pool. For example in case a shutdown takes a while, then there is activity in the logs.
...
Method | Description |
---|---|
shutdown | Marks the thread pool as shutdown, eg just as calling |
shutdownNow | Forces the thread pool to shutdown now, eg just as calling |
shutdownGraceful | Camel 2.10.211: Marks the thread pool as shutdown, and graceful shutdown the pool, by waiting for tasks to complete. A default timeout value of 10 sec is used, before |
shutdownGraceful(timeout) | Camel 2.10.211: As above but with custom timeout value |
awaitTermination | Camel 2.10.211: To wait graceful for the termination of a thread pool (eg to wait for its tasks to complete). Will wait until all tasks is completed or a timeout value is hit. |
...