Federico Mariani created CAMEL-27076:
----------------------------------------

             Summary: camel-mdc - camel.routeId is the route that created the 
exchange, not the route being run
                 Key: CAMEL-27076
                 URL: https://issues.apache.org/jira/browse/CAMEL-27076
             Project: Camel
          Issue Type: Bug
            Reporter: Federico Mariani


With camel-mdc, the {{camel.routeId}} MDC value is the id of the route that 
created the exchange ({{Exchange.getFromRouteId()}}), not the route that runs 
the processor or the log. When a route calls another route, every log line of 
the called route shows the calling route:

{code:java}
from("direct:a").routeId("a")
    .to("direct:b");

from("direct:b").routeId("b")
    .log("in b"); // camel.routeId is a
{code}

The deprecated MDC logging ({{camel.main.useMdcLogging=true}}), which camel-mdc 
replaces, gives {{b}} here.

Expected: {{camel.routeId}} is the route being run ({{b}} inside route b), and 
{{a}} again when the exchange is back in route a.

_Claude Code on behalf of Federico Mariani_



--
This message was sent by Atlassian Jira
(v10.3.26#10030026)

Reply via email to