You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Manuel Shenavai (Jira)" <ji...@apache.org> on 2021/03/30 14:40:00 UTC

[jira] [Comment Edited] (CAMEL-16197) CXF Attachment stay in file system after processing if file attachments has not been used

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

Manuel Shenavai edited comment on CAMEL-16197 at 3/30/21, 2:40 PM:
-------------------------------------------------------------------

Hi Claus,

sorry for reopening this issue. I think we need the same fix for the cxfProducer: [https://github.com/Talend/apache-camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java#L187]

I attached a project to reproduce the problem. To reproduce:
 1) Start Server.java
 2) Start Client.java
 3) Check the cxf tmp folder (printed in the console output)
 4) Find 3 orphaned tmp-files in the tmp folder

Best regards,
 Manuel


was (Author: mash-sap):
Hi Claus,

I think we need the same fix for the cxfProducer: [https://github.com/Talend/apache-camel/blob/master/components/camel-cxf/src/main/java/org/apache/camel/component/cxf/CxfProducer.java#L187]

I attached a project to reproduce the problem. To reproduce:
1) Start Server.java
2) Start Client.java
3) Check the cxf tmp folder (printed in the console output)
4) Find 3 orphaned tmp-files in the tmp folder

Best regards,
Manuel

> CXF Attachment stay in file system after processing if file attachments has not been used
> -----------------------------------------------------------------------------------------
>
>                 Key: CAMEL-16197
>                 URL: https://issues.apache.org/jira/browse/CAMEL-16197
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-cxf
>    Affects Versions: 2.25.3
>            Reporter: Manuel Shenavai
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 3.10.0
>
>         Attachments: attachment2.zip, attachments.3.7.zip, attachments.zip
>
>
> Hi everyone,
>  
> we are using the camel CXF component and found that the cleanup of cached attachments is not working as expected. CXF will persist attachments to disk whenever they exceed a certain limit in size: [cxf source|https://github.com/apache/cxf/blob/3.2.x-fixes/core/src/main/java/org/apache/cxf/io/CachedOutputStream.java#L433] If the attachments are consumed within the route, i.e. when they are used to send a message, the files will be removed from the filesystem. In case they are not used at all, the files will stay in the filesystem. So the CXF component somehow assumes that the attachments are consumed within the route.
>  
> Example
> We send a message that contains a attachment to a CXF endpoint. The attachment-size exceeds the size threshold and therefore will be persisted to disk. During message processing the attachment will not be used (the endpoint is oneway and attachments are not used within the route). After message processing, the file stays in the filesystem.
>  
> Reproduce with attached example project:
>  # Start the Server.java test (starts the server taking the requests)
>  # Start the Client.java (sends a request to the server)
>  # Check the temp folder (printed in console by Client.java, in my case “C:\Users\me\AppData\Local\Temp\cxf-tmp-3330821712753099698)
>  # Repeat executing Client.java and find for each run a new tmp-file
>  
> Due to this file leaks, the filesystem will be filled up over time.  
> Best regards,
> Manuel



--
This message was sent by Atlassian Jira
(v8.3.4#803005)