Apache Camel:我是否需要使我的 FTP-Consumer 路由具有事务性? [英] Apache Camel: Do I need to make my FTP-Consumer route transactional?
问题描述
我有这些 FTP 端点属性:
I have these FTP endpoint properties:
include=.*.xml&delay=60s&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&binary=true&move=.done&soTimeout=300000
因此端点需要每 60 秒搜索一次 *.xml 文件并使用它.之后,文件将继续并移动到完成"目录中.
So an endpoint need to search every 60 secounds the *.xml files and consume it. After that the files will be proceed and moved in 'done' directory.
恐怕如果 f.e.移动文件时发生 IOException,该文件将已从端点根目录中删除.
I'm afraid that if f.e. by doing the move of a file an IOException occures, the file will already be deleted from the endpoint root directory.
问题是:我是否需要使我的 FTP-Consumer 路由具有事务性?
The question is: do I need to make my FTP-Consumer route transactional?
另一个问题是:您能否建议为这种情况添加另一个有用的 ftp 消费者属性?
Another question is: can you give an advise to add another usefull ftp consumer properties for this case?
推荐答案
如果 f.e.通过移动文件发生 IOException
if f.e. by doing the move of a file an IOException occures
根据GenericFileEndpoint.java 您可以使用 setMoveFailed()
定义在移动失败时将文件移动到何处.FTP 端点应继承该选项,请参见此处:FtpEndpoint
According to GenericFileEndpoint.java you can use setMoveFailed()
to define where to move the file if the moving fails.
The FTP endpoint should inherit that option, see here: FtpEndpoint
我认为您不需要使端点具有事务性.
I do not think that you need to make you endpoint transactional.
这篇关于Apache Camel:我是否需要使我的 FTP-Consumer 路由具有事务性?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!