Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Fixed
-
3.13.0, 3.14.0
-
None
-
Unknown
Description
Expected Behaviour:
If UseMDCLogging=true and UseBreadcrumb=true is set then i expect then everywhere the MDC Value camel.breadcrumbId is set.
like it works in Camel Version < 3.12
Reproducable
Camel Version > 3.11
Hint: If I use a custom UnitOfWorkFactory it works as expected. But I would assume that If MDCLogging is enabled then the DefaultUnitOfWork would handle this.
Log without MDC camel.Breadcrumb:
2022-01-19 12:01:00,335 INFO [1 - timer://foo] route1 [route1 0141fbc5-bb47-4458-a982-1e6585109b8a] - Received exchange with breadcrumbID: 0141fbc5-bb47-4458-a982-1e6585109b8a
2022-01-19 12:01:00,337 INFO [1 - timer://foo] c.t.a.r.h.HelloBreadcrumbRoute [route1 0141fbc5-bb47-4458-a982-1e6585109b8a] - Process with bug
2022-01-19 12:01:00,338 INFO [1 - timer://foo] c.t.a.r.h.OnExceptionProcessor [***breadcrumbMissing***] - Some OnException process
2022-01-19 12:01:00,344 INFO [1 - timer://foo] route2 [route2 ***breadcrumbMissing***] - Deadletter receive
Example:
@Override
public void configure() throws Exception {
getContext().setUseMDCLogging(true);
getContext().setUseBreadcrumb(true);
DeadLetterChannelBuilder errorHandlerBuilder = new DeadLetterChannelBuilder();
errorHandlerBuilder.setDeadLetterUri("direct:deadletterTest");
errorHandlerBuilder.setOnExceptionOccurred(onExceptionProcessor);
errorHandler(errorHandlerBuilder);
from("timer://foo?fixedRate=true&period=10000")
.log("Received exchange with breadcrumbID: ${in.headers.breadcrumbId}")
.process(exchange ->
);
from("direct:deadletterTest")
.log("Deadletter received ${body}");
}
OnExceptionProcessor:
@Component
public class OnExceptionProcessor implements Processor {
private static final Logger LOG = LoggerFactory.getLogger(OnExceptionProcessor.class);
@Override
public void process(Exchange exchange) throws Exception
}
Attachments
Issue Links
- relates to
-
CAMEL-17009 camel-core - Camel does not clear MDC correctly
- Resolved
-
CAMEL-17676 MDC not working anymore while logging failed delivery
- Resolved