Details
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.