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

Claus Ibsen commented on CAMEL-8419:
------------------------------------

It should be done like camel-jetty does, it lets the consumer create the uow 
and handle that lifecycle
https://github.com/apache/camel/blob/master/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java#L146

Then it writes the response
https://github.com/apache/camel/blob/master/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java#L198

And in the finally it done the UoW
https://github.com/apache/camel/blob/master/components/camel-jetty-common/src/main/java/org/apache/camel/component/jetty/CamelContinuationServlet.java#L206

Then the stream cache which may have been offloaded to disk will only get the 
file deleted after the consumer has sent back the response. 

> Camel StreamCache does not work with CXF consumer for InOut messages
> --------------------------------------------------------------------
>
>                 Key: CAMEL-8419
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8419
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.14.1
>            Reporter: Stephan Siano
>             Fix For: 2.15.1, 2.16.0
>
>         Attachments: 
> 0001-CAMEL-8419-Camel-StreamCache-does-not-work-with-CXF-.patch
>
>
> If a route that is started by a CXF consumer and has an InOut exchange 
> pattern (meaning that the CXF consumer is returning a response back to the 
> caller) contains a StreamCache as message object that is not in memory, 
> returning the payload will fail.
> The reason for this is that an on-disk stream cache in Camel will be removed 
> when the LUW ends, but CXF will return the response afterwards.
> See the two attached unit tests for details.
> I don't like the actual patch too much, as it copies on-disk camel stream 
> caches into CXF stream caches when creating the CXF message object in camel 
> CXF, but this is about the last step before the LUW ends (and the file gets 
> deleted).



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to