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

Problems with DefaultCamelContext constructor calling Container.Instance.manage()

Attach filesAttach ScreenshotVotersWatch issueWatchersCreate sub-taskLinkCloneUpdate Comment AuthorReplace String in CommentUpdate Comment VisibilityDelete Comments
    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 2.16.3, 2.17.0
    • camel-core
    • None
    • Unknown

    Description

      This code can cause problems when Camel runs in a container (like WildFly) with CDI.

      The code assumes that the camel context will get started and stopped at some point during its lifecycle, which then triggers an unmanage from the Container instance object.

      With CDI, this scenario may not happen. Especially when CDI proxies are created for @Injecting camel contexts into beans. The camel context in this scenario is never started or stopped, resulting in this map of contexts filling up with redundant objects.

      Not sure what the best way of dealing with this is. It'd be nice to remove the Container.manage code from the DefaultCamelContext default constructor or implement Container in such a way that clients can override its behaviour.

      Attachments

        Activity

          This comment will be Viewable by All Users Viewable by All Users
          Cancel

          People

            davsclaus Claus Ibsen
            jamesnetherton James Netherton
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Slack

                Issue deployment