骆驼异常无视

时间:2016-09-09 12:41:35

标签: exception apache-camel

我想忽略路由中的异常(java.util.zip.ZipException)。我希望不记录此异常。我已经尝试过onException子句并处理并继续使用它。但它没有奏效。特别是处理和继续不合作。

2 个答案:

答案 0 :(得分:1)

You can put the code in doFinally block

http://camel.apache.org/try-catch-finally.html

答案 1 :(得分:0)

您是否将异常标记为已处理?

onException(ZipException.class)
    .handled(true)
    ...;

来自http://camel.apache.org/exception-clause.html

// we mark the exchange as handled so the caller doesn't receive the
// OrderFailedException but whatever we want to return instead