Apache Camel onException
问题 I want to catch all Exception from routes. I add this OnExeption : onException(Exception.class).process(new MyFunctionFailureHandler()).stop(); Then, I create the class MyFunctionFailureHandler. public class MyFunctionFailureHandler implements Processor { @Override public void process(Exchange exchange) throws Exception { Throwable caused; caused = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Throwable.class); exchange.getContext().createProducerTemplate().send("mock:myerror", exchange); }