Versions Compared

Key

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

...

We have introduced a ShutdownableService to expose a shutdown method which services can implement for their shutdown logic.
Then we can only shutdown thread pools in doShutdown() and not as before in doStop().

By letting Camel keep track of created thread pool, then Camel knows which pools shutdown when its stopping. Then the need for doShutdown is not as apparent as before, but its good to have this state in the lifecycles as well, for future needs.

Status: DONE

The problem with Component, Endpoint

...

Using the DefaultExecutorServiceStrategy we can let Camel keep track of the created pools, and thus also it can shutdown those when CamelContext is shutting down. Then Camel is handling the lifecycle for the pools it creates. And if you pass in a thread pool from an external system then you manage that lifecycle. Camel will in those cases not shut it down. IN PROGRESS

Sensible defaults

The CachedExecutorService by the JDK is maybe a bit rough aggressive as its unbounded thread pool which essentially can create 1000s of threads if the sever is not busy. But end users may want to have a reasonable max size, lets say 100. So we should offer some sort of rule which you can configure what the default settings should be for thread pools created by Camel.

...