Apache camel 使用camel-stax进行文件处理不需要';我不能正常工作

Apache camel 使用camel-stax进行文件处理不需要';我不能正常工作,apache-camel,stax,Apache Camel,Stax,我正在尝试使用camelstax创建一个处理大型xml文件的路由。文件内容处理工作正常,但最终失败,出现以下错误: Caused by: java.io.IOException: Renaming file from: C:\workdir\file.xml to: C:\workdir\.camel\file.xml failed due cannot delete from file: C:\workdir\file.xml after copy succeeded camel似乎不会关闭

我正在尝试使用camelstax创建一个处理大型xml文件的路由。文件内容处理工作正常,但最终失败,出现以下错误:

Caused by: java.io.IOException: Renaming file from: C:\workdir\file.xml to: C:\workdir\.camel\file.xml failed due cannot delete from file: C:\workdir\file.xml after copy succeeded
camel似乎不会关闭文件输入流,因此在处理之后,它无法将文件移动到目标位置。当然,我可以设置noop=true,这是我想要删除已处理文件的位

我的路线如下所示:

<route id="myRoute">
        <from uri="file:{{working_dir}}?include=file.xml" />
        <split streaming="true">
            <ref>staxRecord</ref>
            <to uri="log:test"/>
        </split>
    </route>
<route id="myRoute">
    <from uri="file:{{working_dir}}?include=file.xml&amp;delete=true" />
    <split streaming="true">
        <tokenize token="entry" xml="true"/>
        <unmarshal ref="myJaxb"/>
        <!-- ... -->
    </split>
</route>

史达克斯唱片
最初它有点复杂,我尽可能简化了它。现在它看起来就像这里的最后一个样本


附加说明:我在Windows上执行路由。Camel版本:2.12.2。

因此它看起来像Camel-stax组件中的一个bug

我找到了处理大型xml文件的另一种方法。我将我的路线改写如下:

<route id="myRoute">
        <from uri="file:{{working_dir}}?include=file.xml" />
        <split streaming="true">
            <ref>staxRecord</ref>
            <to uri="log:test"/>
        </split>
    </route>
<route id="myRoute">
    <from uri="file:{{working_dir}}?include=file.xml&amp;delete=true" />
    <split streaming="true">
        <tokenize token="entry" xml="true"/>
        <unmarshal ref="myJaxb"/>
        <!-- ... -->
    </split>
</route>


我认为这是一个与windows相关的错误。我运行了camel-stax组件测试。它们成功地执行了,但target/camle-stax-test.log文件包含相同的回溯:fpaste.org/78642/39282879听起来好像需要在camel-stax中的某个地方关闭输入流