1 回答

TA贡献1886条经验 获得超2个赞
该文件很可能在目标目录中被覆盖,但是在完成后,它被移动到.camel
目录中。
这是预期的行为,请参阅文件组件文档:
路由完成后(发布命令)执行任何移动或删除操作
最好回滚你的路由,它默认将文件保存在源目录中。
final String URI_FILE = "file:{{PATH}}";
final String POOLER = "&scheduler=quartz2&scheduler.cron=0+0/10+*+*+*+?";
from(URI_FILE + POOLER)
.pollEnrich().simple("{{URL_CHECKER}}",String.class).aggregationStrategy(new myEstratey())
.choice()
.when(exchangeProperty("CONTINUE").isEqualTo(true))
.log("Condition was met")
.to(URI_DIRECT) //To another route
.endChoice()
.otherwise()
.log("I'll try again later")
.rollback() // rollback processing and keep file in original directory
.endChoice();
添加回答
举报