...
From Camel 2.10.2 onwards Camel the graceful shutdownshutdownGraceful(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 30000
10000
millis. You can configure a custom value on the ExecutorServiceManager
if needed. During shutdown Camel will log every 5th 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.
The APIs on ExecutorServiceManager
that is related to shutting down a thread pool is as follows:
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.2: 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.2: As above but with custom timeout value |
awaitTermination | Camel 2.10.2: 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. |