[ https://issues.apache.org/jira/browse/CAMEL-18367?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17798936#comment-17798936 ]
Nathan commented on CAMEL-18367: -------------------------------- I think this is normal actually, if I understand the internal logic correctly the MDCUnitOfWork is meant to safeguard the MDC against changes from asynchronous threads. Since the internal processor always does things synchronously if there is a transaction, there is no reason to call the MDCUnitOfWork. > Unable to use MDC variables in transacted route > ----------------------------------------------- > > Key: CAMEL-18367 > URL: https://issues.apache.org/jira/browse/CAMEL-18367 > Project: Camel > Issue Type: Bug > Components: camel-core > Affects Versions: 3.14.4 > Reporter: Rastislav Papp > Priority: Minor > > I have a route which is {{{}.transacted(){}}}. I use {{{}MDCUnitOfWork{}}}, > whose {{beforeProcess}} and {{afterProcess}} methods are called in > {{CamelInternalProcessor}} - {*}but only if the route is not transacted{*}. > With my limited camel internals knowledge, I do not understand why > {{beforeProcess}} and {{afterProcess}} are called only for non-transacted > routes. In my typical scenario, MDC variables work well until I get to a > transacted route, then at the last processor before the transacted route the > {{afterProcess}} (which clears MDC variables) is called, and > {{beforeProcess}} is never called, so there are no MDC variables inside the > transacted route. -- This message was sent by Atlassian Jira (v8.20.10#820010)