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

Apache Camel File Append Not Working in Windows

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Major
    • Resolution: Duplicate
    • 2.24.1
    • None
    • camel-core
    • None
    • Windows 10, JDK 11

    Description

      I have a simple route where I write some string to an output file and then trying to append the contents of the original file. But it ignores and it overwrites the file.

       

      {{from("file://inputFolder")}}

      *{{{{.routeId("InputFolderToTestSedaRoute")
      .setProperty("myFileConsumedBody", simple("${body}"))
      .setBody(constant("FIRST LINE!"))}}}}*

      *{{.to("file://{{outputFolder")
      .setBody(simple("${exchangeProperty.myFileConsumedBody}"))}}}}*

      {{.log("** STEP 100: ${headers} :**")}}

      *{{{{.delay(10000)
      .to("file://outputFolder?fileExist=Append")
      ;}}}}*

      I added delay to observe what happens.

      1. If there is an input file named myFile.txt, Camel picks that file as expected.
      2. It keeps the file to an custome exchange property as in the code.
      3. It opens a file named myFile.txt and writes the content "FIRST LINE!" in it and waits for the delay to expire.
      4. I can open and verify the contents, everything looks good.
      5. Once delay expires, Camel overwrites the file myFile.txt with the original content it picked from input folder (even though I have asked Camel to append).

       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              sreejeshraj Sreejesh
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: