Exception 在java端异常后继续消息流

Exception 在java端异常后继续消息流,exception,routing,apache-camel,Exception,Routing,Apache Camel,我只是在尝试,在发生异常后继续处理消息。我知道,使用“…”是可能的,我发现了以下内容,并将尝试一下 捕获异常=exchange.getException() // we continue so clear any exceptions exchange.setException(null); // clear rollback flags exchange.setProperty(Exchange.ROLLBACK_ONLY, null); // rese

我只是在尝试,在发生异常后继续处理消息。我知道,使用“…”是可能的,我发现了以下内容,并将尝试一下

捕获异常=exchange.getException()

    // we continue so clear any exceptions
    exchange.setException(null);
    // clear rollback flags
    exchange.setProperty(Exchange.ROLLBACK_ONLY, null);
    // reset cached streams so they can be read again
    MessageHelper.resetStreamCache(exchange.getIn());

    // its continued then remove traces of redelivery attempted and caught exception
    exchange.getIn().removeHeader(Exchange.REDELIVERED);
    exchange.getIn().removeHeader(Exchange.REDELIVERY_COUNTER);
    exchange.getIn().removeHeader(Exchange.REDELIVERY_MAX_COUNTER);
    exchange.removeProperty(Exchange.FAILURE_HANDLED);
    // keep the Exchange.EXCEPTION_CAUGHT as property so end user knows the caused exception