I am using Java DSL to configure the routes. I have a route similar to what's been given below.
RouteBuilder builder = new RouteBuilder() {
public void configure() {
// onException(Exception.class).bean("bean");
onException(Exception.class).to("anotherProcessor");
from("queue:a").bean("someBean").to("processor");
}
};
How do i blow up the exception after doing some activity? On exception, I tried configuring a processor and a bean to rethrow the exception. Either way, camel is setting the exception to exchange but not blowing up the exception.
I am doing this in a junit test case. I am handling the exception using onException processor. Inside the processor, i am doing my assertions. The assertion errors are handled automatically by camel and the tests are not getting marked as pass/fail.
transferException=true(see documentation). You also might have to call.handled(false)in youronExceptionstatement. I don't remember what the Camel default is if the error is handled by a processor. Might be that Camel marks the exception as handled by default. - Ralf