Uploaded image for project: 'Camel'
  1. Camel
  2. CAMEL-16197

CXF Attachment stay in file system after processing if file attachments has not been used

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 2.25.3
    • Fix Version/s: 3.10.0
    • Component/s: camel-cxf
    • Labels:
      None
    • Estimated Complexity:
      Unknown

      Description

      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 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:

      1. Start the Server.java test (starts the server taking the requests)
      2. Start the Client.java (sends a request to the server)
      3. Check the temp folder (printed in console by Client.java, in my case “C:\Users\me\AppData\Local\Temp\cxf-tmp-3330821712753099698)
      4. 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

        Attachments

        1. attachment2.zip
          52 kB
          Manuel Shenavai
        2. attachments.3.7.zip
          13 kB
          Manuel Shenavai
        3. attachments.zip
          9 kB
          Manuel Shenavai

          Issue Links

            Activity

              People

              • Assignee:
                davsclaus Claus Ibsen
                Reporter:
                mash-sap Manuel Shenavai
              • Votes:
                0 Vote for this issue
                Watchers:
                2 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: