-
Notifications
You must be signed in to change notification settings - Fork 5.1k
fix(components): enable any async EIP to reuse main MDC context #20478
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
* Added a stack based MDC push/pop, by storing temporary the context before the exchange execution and setting back after it. * Removed the check of no MDC after test execution. This is due to the fact that we cannot reliably clean the context as other async processes (eg, InterceptSendToEndpoint EIP) could need to use the context previously set. In any case, this is not a consistency break, as, by design, we always reset the MDC context before any execution (either sync or async). * The only side effect is that the unit tests cannot check any longer that there is no MDC context as, this will be maintained (as required by those EIP mentioned earlier). Closes CAMEL-22717
|
🌟 Thank you for your contribution to the Apache Camel project! 🌟 🤖 CI automation will test this PR automatically. 🐫 Apache Camel Committers, please review the following items:
|
components/camel-mdc/src/test/java/org/apache/camel/mdc/MDCAllHeadersTest.java
Outdated
Show resolved
Hide resolved
components/camel-mdc/src/test/java/org/apache/camel/mdc/MDCDefaultTest.java
Show resolved
Hide resolved
|
@Croway thanks for the review comment, now the tests are much more idiomatic, please, have a look. |
|
To cherrypick the other PRs doc and unit test developed. |
Closes CAMEL-22717
Description
Target
mainbranch)Tracking
Apache Camel coding standards and style
mvn clean install -DskipTestslocally from root folder and I have committed all auto-generated changes.