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

camel-core - Cannot set tracer on a started CamelContext

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.14.0
    • 3.14.1, 3.15.0
    • came-core
    • None
    • OS: Windows 8 / Windows 10
      Java: OpenJDK 11 (OpenJDK Runtime Environment AdoptOpenJDK (build 11.0.10+9))
      Camel: 3.14.0

    • Unknown

    Description

      context = new DefaultCamelContext(registry);

        //setting tracing standby to true, so it can be enabled during runtime
       context.setTracingStandby(true);

       

      During runtime I later want to set the tracing on demand:

              Tracer tracer = context.getTracer();
              tracer.setEnabled(true);            

      Following the documentation: https://camel.apache.org/manual/tracer.html

      However when setting:

       context.setTracingStandby(true);

      And then start a Camel route (context.addRoute(myRoute); or context.addOrUpdateRoutes(myRoute)) I get the following error:

      org.apache.camel.FailedToCreateRouteException: Failed to create route 33-33 at: >>> SetHeader[AssimblyHeaderId, null] <<
      < in route: Route(33-33)[Fromfile://C:\test1 -> [SetHeader[AssimblyHea... because of Cannot set tracer on a started Ca
      melContext
              at org.apache.camel.reifier.RouteReifier.doCreateRoute(RouteReifier.java:240)
              at org.apache.camel.reifier.RouteReifier.createRoute(RouteReifier.java:74)
              at org.apache.camel.impl.DefaultModelReifierFactory.createRoute(DefaultModelReifierFactory.java:49)
              at org.apache.camel.impl.DefaultCamelContext.startRouteDefinitions(DefaultCamelContext.java:868)
              at org.apache.camel.impl.DefaultModel.addRouteDefinitions(DefaultModel.java:185)
              at org.apache.camel.impl.DefaultCamelContext.addRouteDefinitions(DefaultCamelContext.java:336)
              at org.apache.camel.builder.RouteBuilder.populateOrUpdateRoutes(RouteBuilder.java:652)
              at org.apache.camel.builder.RouteBuilder.updateRoutesToCamelContext(RouteBuilder.java:530)

      In my routebuilder or before I can not find an entry where I set the tracer. In 3.11.x I have the following context.setTracer(true);  (but I removed this line). Could you check if you can reproduce this?

      When I put the following line in comment the error goes away:

      //context.setTracingStandby(true);

      But then I cannot set it at runtime.

       

       

      Attachments

        Activity

          People

            davsclaus Claus Ibsen
            skin27 Raymond
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: