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

ZipAggregationStrategy loses onCompletion

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Fixed
    • 3.19.0
    • 3.20.0
    • camel-zipfile
    • None
    • Unknown

    Description

      We are facing an issue where we end up with stale files in the temp directory (on Windows: C:\Users\...\AppData\Local\Temp). This stops our application from running.

       

      Problem description:

      When using "Split Definition" with "ZipAggregationStrategy", we try to aggregate multiple parts in one zip archive. Our Code does exactly that and works fine, but it misses the step to delete the temporaly created archive (created automactly) in the temp directory after completion.

       

      We would expect that the completion of the route does the deletion.

       

      Having a look in into the code, we saw that the "ZipAggregationStrategy" does have a "DeleteZipFileOnCompletion", which does exactly that. The "OnCompletion" is also added to the exchange. However,  the deletion is never executed, due to a copy of the subexchange to the original exchange (losing the previously added onComplete)

       

      Attached you can find code to reproduce the issue.

       

      Attachments

        1. zipaggregator-oncomplete.zip
          32 kB
          Alexander Lex

        Issue Links

          Activity

            People

              davsclaus Claus Ibsen
              AlexanderLex Alexander Lex
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: