Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/delphi/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Apache camel Apache驼峰文件附加在Windows中不起作用_Apache Camel_Eai - Fatal编程技术网

Apache camel Apache驼峰文件附加在Windows中不起作用

Apache camel Apache驼峰文件附加在Windows中不起作用,apache-camel,eai,Apache Camel,Eai,我有一个简单的路径,我在输出文件中写入一些字符串,然后尝试附加原始文件的内容。但它会忽略并覆盖该文件 from("file://inputFolder") .routeId("InputFolderToTestSedaRoute") .setProperty("myFileConsumedBody", simple("${body}")) .setBody(constant("FIR

我有一个简单的路径,我在输出文件中写入一些字符串,然后尝试附加原始文件的内容。但它会忽略并覆盖该文件

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")
    ;
我增加了延迟来观察发生了什么

  • 如果有一个名为myFile.txt的输入文件,Camel将按预期选择该文件
  • 它将文件保留为代码中的custome exchange属性
  • 它打开一个名为myFile.txt的文件,并在其中写入内容“FIRST LINE!”,然后等待延迟过期
  • 我可以打开并验证内容,一切看起来都很好
  • 延迟过期后,Camel将使用从输入文件夹中拾取的原始内容覆盖文件myFile.txt(即使我已要求Camel追加)
  • 我在这里犯了什么错误吗?不确定这是否特定于Windows 10。我使用的是Camel版本2.24.1。谢谢您的时间。

    这是版本
    2.24.3
    中修复的错误。您可以使用
    charset
    选项升级或使用变通方法

    .to("file://outputFolder?fileExist=Append&charset=utf-8")
    
    这是版本
    2.24.3
    中修复的错误。您可以使用
    charset
    选项升级或使用变通方法

    .to("file://outputFolder?fileExist=Append&charset=utf-8")