You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Vladimir Dobos (Jira)" <ji...@apache.org> on 2022/02/28 09:09:00 UTC

[jira] [Created] (CAMEL-17721) MDC - custom MDC property value is fixed to first assigned value by MDCUnitOfWork

Vladimir Dobos created CAMEL-17721:
--------------------------------------

             Summary: MDC - custom MDC property value is fixed to first assigned value by MDCUnitOfWork
                 Key: CAMEL-17721
                 URL: https://issues.apache.org/jira/browse/CAMEL-17721
             Project: Camel
          Issue Type: Bug
    Affects Versions: 3.14.1, 3.11.5
            Reporter: Vladimir Dobos


Once value (that matches "mdc-logging-keys-pattern" from configuration) is assigned/set to MDC and gets into MDCUnitOfWorks#MDCCallback "custom" map, it cannot be changed further down in the route (at least in processor), as changed value is always overwritten at the end of processing step with original value.

This breaks use-cases, when you want to assign temporary value to one MDC property to signify the value could not be retrieved during some processing steps (but can be assigned further down).

For example, when you assign, for example N/A to property "someID" in processor right after consumer at the start of route and want to change it few steps down, it will be overwritten back to "N/A" by MDCCallback.

Tested in single-threaded route with no async processing.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)