-
Bug
-
Resolution: Done
-
Undefined
-
None
-
None
There seems to be a Otel context leak when using a direct producer in async mode. This causes different requests to have the same traceId.??As a workaround, setting synchronous=true??on the CXF producer resolves the issue. Here's a reproducer:
@Override protected RoutesBuilder createRouteBuilder() { return new RouteBuilder() { @Override public void configure() { from("direct:start").routeId("myRoute") .to("direct:send") .end(); from("direct:send") .log("message") .to("cxfrs:http://localhost:" + port1 + "/rest/helloservice/sayHello?synchronous=false"); // setting to 'true' resolves the issue restConfiguration() .port(port1); rest("/rest/helloservice") .post("/sayHello").routeId("rest-GET-say-hi") .to("direct:sayHi"); from("direct:sayHi") .routeId("mock-GET-say-hi") .log("example") .to("mock:end"); }};
??
I've added the complete unit here: https://github.com/apache/camel/blob/7d83a62b8e442dc9ac6fd79b153192add940301e/components/camel-opentelemetry/src/test/java/org/apache/camel/opentelemetry/AsyncCxfTest.java
- links to