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.
恐怕如果通过移动文件发生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消费者路由具有事务性?
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?
推荐答案
如果通过移动文件会发生IOException
if f.e. by doing the move of a file an IOException occures
根据 GenericFileEndpoint.java ,如果移动失败,则可以使用setMoveFailed()
定义将文件移动到的位置.
FTP端点应继承该选项,请参见此处:
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屋!