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

RouteTemplates creating in CDI are configured out-of-order

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Won't Do
    • Affects Version/s: 3.5.0
    • Fix Version/s: 3.x
    • Component/s: camel-cdi
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      When:

      • using Camel with CDI
      • having routes defined in multiple beansĀ 
      • one bean defines the route template
      • another bean attempts to create a route from that template

      I would expect that the route templates are configured before any routes that build from them.

      What happens is non-deterministic based on the order the RoutesBuilder instances are provided by the CDI runtime. In a good case, the template bean is processed first and all is as-expected. However, when the template bean is provided after any bean that attempts to build from it we get the error:

      Caused by: java.lang.IllegalArgumentException: Cannot find RouteTemplate with id ListProcess
      {{ at org.apache.camel.quarkus.core.BaseModel.addRouteFromTemplate(BaseModel.java:167)}}
      {{ at org.apache.camel.quarkus.core.FastCamelContext.addRouteFromTemplate(FastCamelContext.java:188)}}
      {{ at org.apache.camel.builder.TemplatedRouteBuilder.add(TemplatedRouteBuilder.java:104)}}

      Attempted a workaround by annotating the template bean with @Priority(1), however this had no effect.

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                Unassigned
                Reporter:
                kemitix Paul Campbell
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: