Apache Camel: Do I need to make my FTP-Consumer route transactional?(Apache Camel:我需要让我的 FTP-Consumer 路由交易吗?)
问题描述
我有这些 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 路由交易吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!
本文标题为:Apache Camel:我需要让我的 FTP-Consumer 路由交易吗?


基础教程推荐
- 如何在 JFrame 中覆盖 windowsClosing 事件 2022-01-01
- 大摇大摆的枚举 2022-01-01
- 如何在 Spring @Value 注解中正确指定默认值? 2022-01-01
- 从 python 访问 JVM 2022-01-01
- 验证是否调用了所有 getter 方法 2022-01-01
- 多个组件的复杂布局 2022-01-01
- 在 Java 中创建日期的正确方法是什么? 2022-01-01
- Java Swing计时器未清除 2022-01-01
- Java 实例变量在两个语句中声明和初始化 2022-01-01
- 不推荐使用 Api 注释的描述 2022-01-01