Since we're on a major migration process of this website, some component documents here are out of sync right now. In the meantime you may want to look at the early version of the new website
https://camel.apache.org/staging/
We would very much like to receive any feedback on the new site, please join the discussion on the Camel user mailing list.
Why is the exception null when I use onException?If you use .onException(Exception.class).handled(true) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { Exception cause = exchange.getException()); // why cause exception is null ??? } }) .end() Then make notice that because you use Instead you can access the caused exception from a property on the exchange with the key .onException(Exception.class).handled(true) .process(new Processor() { @Override public void process(Exchange exchange) throws Exception { Exception cause = exchange.getProperty(Exchange.EXCEPTION_CAUGHT, Exception.class); // we now have the caused exception } }) .end() |