camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ASF GitHub Bot (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CAMEL-12108) StreamCache file is removed before wireTap ends in a splitter wireTap combination route
Date Wed, 03 Jan 2018 10:10:00 GMT

    [ https://issues.apache.org/jira/browse/CAMEL-12108?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16309413#comment-16309413
] 

ASF GitHub Bot commented on CAMEL-12108:
----------------------------------------

davsclaus closed pull request #2159: CAMEL-12108 - PR on behalf of Bas Claessen
URL: https://github.com/apache/camel/pull/2159
 
 
   

This is a PR merged from a forked repository.
As GitHub hides the original diff on merge, it is displayed below for
the sake of provenance:

As this is a foreign pull request (from a fork), the diff is supplied
below (as it won't show otherwise due to GitHub magic):

diff --git a/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java b/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
index b95800a4191..5015d187223 100644
--- a/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
+++ b/camel-core/src/main/java/org/apache/camel/processor/WireTapProcessor.java
@@ -227,6 +227,9 @@ private Exchange configureCopyExchange(Exchange exchange) {
         Exchange copy = ExchangeHelper.createCorrelatedCopy(exchange, false);
         // set MEP to InOnly as this wire tap is a fire and forget
         copy.setPattern(ExchangePattern.InOnly);
+        // remove STREAM_CACHE_UNIT_OF_WORK property because this wire tap will
+        // close its own created stream cache(s)
+        copy.removeProperty(Exchange.STREAM_CACHE_UNIT_OF_WORK);
         return copy;
     }
 


 

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
users@infra.apache.org


> StreamCache file is removed before wireTap ends in a splitter wireTap combination route
> ---------------------------------------------------------------------------------------
>
>                 Key: CAMEL-12108
>                 URL: https://issues.apache.org/jira/browse/CAMEL-12108
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.20.1
>            Reporter: Bas Claessen
>            Priority: Minor
>         Attachments: CAMEL-12108-WireTapProcessor.patch, TestSplitWireTap.zip
>
>
> When combining the splitter and wireTap functionality an org.apache.camel.RuntimeCamelException
(Cannot reset stream from file) will be thrown when:
> 1. a spooled StreamCache body is created in the wireTap route
> 2. the splitter route ends before the wireTap route
> The splitter will create an Exchange.STREAM_CACHE_UNIT_OF_WORK property to hold the StreamCaches
that will be created by the children of the splitter.
> When doing a wireTap in the splitter route, the property will be copied to the wireTap
route (when using the wireTap defaults).
> StreamCaches created in the wireTap route will now be added to the property as well and
will be closed when the splitter route ends.
> A possible workaround can be to create the wireTap route without copying the original
exchange.
> However I think it is better to remove the Exchange.STREAM_CACHE_UNIT_OF_WORK property
in the org.apache.camel.processor.WireTapProcessor configureExchange method.
> I attached a maven project with a test to demonstrate the issue.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)

Mime
View raw message