【发布时间】:2017-11-01 16:12:37
【问题描述】:
我有以下骆驼配置:
from("file://" + FTP_FILES + "?idempotent=true")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
throw new RuntimeException("test");
}
}).onException(Exception.class).maximumRedeliveries(0);
此代码在无限循环中工作并试图处理相同的文件。
是否可以配置骆驼只是忽略异常?
附言
我也试过
.onException(RuntimeException.class).continued(true);
和
.onException(RuntimeException.class).handled(true)
但结果相同
附言
我只想要与此代码提供的行为相同的行为:
from("file://" + FTP_FILES + "?idempotent=true")
.process(new Processor() {
@Override
public void process(Exchange exchange) throws Exception {
try{
throw new RuntimeException("test");
} catch(RuntimeException e){
// just ignore
}
}
})
【问题讨论】:
-
你用的是什么版本的骆驼
-
@Claus,新版本 - 2.20
-
@Claus Ibsen,确切地说,我使用 CAMEL_VERSION = "2.20.0"
标签: java spring exception-handling apache-camel spring-camel