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

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

commit 04fc6c8d4761786fd3b6fa78f7a5c955d8aa3608
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 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);
+                }
             }
         }
 

Reply via email to