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

camel-core - Parameterized RouteBuilder - add routes while starting the camel context

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.5.0
    • camel-core
    • Unknown

    Description

      Working to create a camel-kamelet component here: https://github.com/apache/camel-k-runtime/issues/375 and there is an issue when the routes templates are materialized:

      Assuming I have a route template defines as:

      routeTemplate("setBody")
          .templateParameter("bodyValue")
          .from("direct:{{routeId}}")
          .setBody().constant("{{bodyValue}}");
      

      And a route like:

      from("direct:template")
          .to("kamelet:setBody/test?bodyValue=bv")
          .to("log:template");
      

      Then the kamelet component would try to create a route named test out of the setBody template and:

      1. if the route is create upon KameletComponent::createEndpoint, then the camel context would fails to materialize the template as there is a concurrent exception because a new route definition is added while the context is iterating over them
      2. if the route is created upon KameletEndpoint::onStart, then the route is not added to the camel context

      Attachments

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              lb Luca Burgazzoli
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: