This is an automated email from the ASF dual-hosted git repository. davsclaus pushed a commit to branch camel-3.18.x in repository https://gitbox.apache.org/repos/asf/camel.git
commit 3728b43c7e7018e0bc4ff0e1c01e8d86d3d5ee8b Author: Claus Ibsen <claus.ib...@gmail.com> AuthorDate: Fri Feb 17 19:33:37 2023 +0100 CAMEL-19066: Do not copy correlationId after multicast (#9367) --- .../main/java/org/apache/camel/processor/MulticastProcessor.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java index 2a3c807fc7c..8497deef8fe 100644 --- a/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java +++ b/core/camel-core-processor/src/main/java/org/apache/camel/processor/MulticastProcessor.java @@ -800,10 +800,13 @@ public class MulticastProcessor extends AsyncProcessorSupport // if we stopped due an exception then only propagate the exception original.setException(subExchange.getException()); } else { - // copy the current result to original, so it will contain this result of this eip + // copy the current result to original (preserve original correlation id), + // so it will contain this result of this eip Object correlationId = subExchange.removeProperty(ExchangePropertyKey.CORRELATION_ID); ExchangeHelper.copyResults(original, subExchange); - subExchange.setProperty(ExchangePropertyKey.CORRELATION_ID, correlationId); + if (correlationId != null) { + subExchange.setProperty(ExchangePropertyKey.CORRELATION_ID, correlationId); + } } }