Raúl Kripalani created CAMEL-7795:
-------------------------------------
Summary: Regression: MDC may lose values after when Async Routing
Engine is used
Key: CAMEL-7795
URL: https://issues.apache.org/jira/browse/CAMEL-7795
Project: Camel
Issue Type: Bug
Components: camel-core
Affects Versions: 2.13.2, 2.12.4
Reporter: Raúl Kripalani
Assignee: Raúl Kripalani
Fix For: 2.12.5, 2.13.3, 2.14.0
CAMEL-6377 introduced some optimisations in the MDC Logging mechanism which
make it lose MDC values when the async routing engine is used.
If we are using an async component such as CXF, the response or done() callback
will be issued from a thread NOT managed by Camel. Therefore, we need the
MDCCallback to reset *ALL* MDC values, not just the routeId (as was intended by
the commits that caused the regression).
The situation may be salvaged by the fact that underlying MDC implementations
use an InheritableThreadLocal, so the first requests after system
initialisation may see correct behaviour, because the MDC values from the
requesting thread is propagated to the newly initialised threads in the
underlying stack's ThreadPool, as the coreThreads are being initialised within
the context of the original threads which act like parent threads.
But after those first attempts, odd behaviour is seen and all responses from
the async endpoint come back without an MDC.
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)