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

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

commit 976934878a6cec252fa3c27d02c1149cd870e267
Author: Claus Ibsen <[email protected]>
AuthorDate: Mon Aug 30 22:33:37 2021 +0200

    CAMEL-16863: WireTap EIP should preserve OUT when copy mode.
---
 .../src/main/java/org/apache/camel/processor/WireTapProcessor.java   | 5 +++++
 1 file changed, 5 insertions(+)

diff --git 
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/WireTapProcessor.java
 
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/WireTapProcessor.java
index f90f7f2..96e27fc 100644
--- 
a/core/camel-core-processor/src/main/java/org/apache/camel/processor/WireTapProcessor.java
+++ 
b/core/camel-core-processor/src/main/java/org/apache/camel/processor/WireTapProcessor.java
@@ -279,6 +279,11 @@ public class WireTapProcessor extends AsyncProcessorSupport
         Exchange copy = 
processorExchangeFactory.createCorrelatedCopy(exchange, false);
         // set MEP to InOnly as this wire tap is a fire and forget
         copy.setPattern(ExchangePattern.InOnly);
+        // move OUT to IN if needed
+        if (copy.hasOut()) {
+            copy.setIn(copy.getOut());
+            copy.setOut(null);
+        }
         // remove STREAM_CACHE_UNIT_OF_WORK property because this wire tap will
         // close its own created stream cache(s)
         copy.removeProperty(ExchangePropertyKey.STREAM_CACHE_UNIT_OF_WORK);

Reply via email to