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

Camel-Blueprint - failed container gets restarted automatically

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • 2.18.0
    • 2.17.4, 2.18.1, 2.19.0
    • camel-blueprint
    • None

    Description

      In case of a wrong endpoint definition, a CamelContext could be automatically restarted even if the start operation was correctly aborted.

      This happens because during BlueprintCamelContext, the CamelContext instance is registered as a ServiceListener

      https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L102

      Due to that reason, even after a stop() call is invoked by the error execution branch of start(), that instance is receptive to external service events that result in the invocation of this method:

      https://github.com/apache/camel/blob/master/components/camel-blueprint/src/main/java/org/apache/camel/blueprint/BlueprintCamelContext.java#L155

      That method has the freedom to start again the CamelContext instance.

      The proposed solution is to use a BlueprintCamelContext local flag to keep track of the successful initialization of the Context, to be able to ignore events in case activation wasn't successful.

      Note that the BlueprintCamelContext instance, un-registers itself as a service listener, only in its destroy() method.

      Attached to JBoss-Fuse linked case, there is a reproducer that shows the issue.

      Attachments

        Issue Links

          Activity

            People

              acosentino Andrea Cosentino
              paolo.antinori Paolo Antinori
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: