You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Freeman Yue Fang (Jira)" <ji...@apache.org> on 2024/10/24 15:46:00 UTC
[jira] [Resolved] (CAMEL-21302) camel-opentelemetry context leak with direct async producer
[ https://issues.apache.org/jira/browse/CAMEL-21302?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Freeman Yue Fang resolved CAMEL-21302.
--------------------------------------
Resolution: Fixed
> camel-opentelemetry context leak with direct async producer
> -----------------------------------------------------------
>
> Key: CAMEL-21302
> URL: https://issues.apache.org/jira/browse/CAMEL-21302
> Project: Camel
> Issue Type: Bug
> Components: camel-opentelemetry
> Reporter: John Poth
> Assignee: Freeman Yue Fang
> Priority: Major
> Fix For: 4.4.5, 4.8.2, 4.9.0
>
>
> There seems to be a Otel context leak when using a CXF 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:
> {code:java}
> @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");
> }};
> {code}
>
> 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
--
This message was sent by Atlassian Jira
(v8.20.10#820010)