Details
-
Improvement
-
Status: Resolved
-
Major
-
Resolution: Fixed
-
2.12.3
-
None
-
Unknown
Description
In environments like OSGi startup ordering is kinda random. Right now CamelContexts's can startup and call
Container.Instance.manage(CamelContext)
before any Container has called Container.Instance.set(). These CamelContexts's will then not be managed.
A neater solution would be, if there is no container currently set:
https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/spi/Container.java#L66
then keep a track of the CamelContext objects in a Set<CamelContext> - until Container.Instance.unmanage() is called when they are stopped; then when Container.Instance.set(Container) is called; all the previously registered CamelContext's can be passed into the Container (and removed from the Set).