Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-7327

Improve Container.Instance API to deal with setting a Container after CamelContexts have been created. There is a big risk CamelContext's won't get managed right now

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.12.3
    • 2.13.1, 2.14.0
    • camel-core, osgi
    • None
    • Unknown

    Description

      In environments like OSGi startup ordering is kinda random. Right now CamelContexts's can startup and call

      Container.Instance.manage(CamelContext)
      

      https://github.com/apache/camel/blob/master/camel-core/src/main/java/org/apache/camel/spi/Container.java#L64

      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).

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            jstrachan James Strachan
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: