【发布时间】:2016-03-17 17:59:59
【问题描述】:
如果我在路由处理交换之前删除文件,我会得到异常: GenericFileOperationFailedException:无法重命名文件。 PollEnrich 尝试将文件从 someFolder 移动到 someFolder/.camel 的策略。
from("wmq:queue:someQueue")//Here we get the message with information about the file
...//some logic
.pollEnrich("file:someFolder?fileName=someFile")
...//some logic
.choice()
.when(...)//Here we compare checksum from message with checksum of the file
.process(new SomeClassProcess)//And if they are different file will be deleted from someFolder
.otherwise()
.to(someAnotherFolder)
.end();
我正在尝试使用 .rollback("errorMessage")
onException(RollbackExchangeException.class)
.log(LoggingLevel.WARN, "SomeExcptn");
from("wmq:queue:someQueue")
...//some logic
.pollEnrich("file:someFolder?fileName=someFile")
...//some logic
.choice()
.when(...)
.process(new SomeClassProcess)//it will delete someFile from someFolder
.rollback()
.otherwise()
.to(someAnotherFolder)
.end();
但是现在我在应用程序的日志中发现了垃圾 - CamelExecutionException。 它有效,但你能帮助解决它吗?
附:我不知道在向 pollEnrich 提供 URI 之前是否需要删除文件,这就是我不使用 noop=true 的原因。在 .otherwise() 中,我需要将文件移动到 .camel。
感谢您的建议!
【问题讨论】:
标签: java apache-camel