You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@camel.apache.org by da...@apache.org on 2023/02/17 18:41:06 UTC

[camel] 02/02: CAMEL-19066: Do not copy correlationId after multicast (#9367)

This is an automated email from the ASF dual-hosted git repository.

davsclaus pushed a commit to branch camel-3.x
in repository https://gitbox.apache.org/repos/asf/camel.git

commit 81e4ef1712aa9d5da71c13c43838e79b82ab56b6
Author: Claus Ibsen <cl...@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 8ea0a05858a..0b5f1f6dc33 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);
+                }
             }
         }