Apache Camel: Do I need to make my FTP-Consumer route transactional?

心已入冬 提交于 2019-12-02 16:00:52

问题


I have these FTP endpoint properties:

include=.*.xml&delay=60s&consumer.bridgeErrorHandler=true&throwExceptionOnConnectFailed=true&binary=true&move=.done&soTimeout=300000

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.

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.

The question is: do I need to make my FTP-Consumer route transactional?

Another question is: can you give an advise to add another usefull ftp consumer properties for this case?


回答1:


if f.e. by doing the move of a file an IOException occures

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.



来源:https://stackoverflow.com/questions/53223264/apache-camel-do-i-need-to-make-my-ftp-consumer-route-transactional

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!