davsclaus commented on code in PR #24060:
URL: https://github.com/apache/camel/pull/24060#discussion_r3425907302
##########
core/camel-api/src/main/java/org/apache/camel/spi/CamelMDCService.java:
##########
@@ -20,7 +20,20 @@
import org.apache.camel.Service;
/**
- * A Camel MDC service is a factory for Mapped Diagnostic Context service.
+ * SPI that plugs a Mapped Diagnostic Context (MDC) propagation implementation
into Camel's exchange processing
+ * pipeline.
+ * <p/>
+ * SLF4J's MDC is thread-local, which means MDC values set on the originating
thread are not automatically visible on
+ * continuation threads used by Camel's async routing engine. Implementations
of this service are responsible for
+ * capturing the current MDC state when an exchange begins processing and
restoring it on each continuation thread, so
+ * that log entries produced across async boundaries carry the same contextual
key-value pairs (e.g.,
+ * {@code camel.exchangeId}, {@code camel.routeId}, custom breadcrumb values).
+ * <p/>
Review Comment:
The class `DefaultCamelMDCService` does not exist in the codebase. The
actual implementation is `org.apache.camel.mdc.MDCService` in the
`components/camel-mdc` module (resolved via `FactoryFinder` with key
`camel-mdc`).
The module location (`camel-core-engine`) is also incorrect — it lives in
`components/camel-mdc`.
```suggestion
* Camel discovers the implementation via the service registry; the default
implementation is
* {@code MDCService} in {@code camel-mdc}. The {@link
org.apache.camel.CamelContext} starts and
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]