I am using camel 2.14.0 and the new rest dsl feature. It seems exception clause is not working with rest dsl. Am I doing anything wrong? Here are my classes:
public MyRouteBuilder extends RouteBuilder {
public void configure() throws Exception {
restConfiguration.component("servlet").bindingMode(RestBindingMode.json);
onException(RuntimeException.class).process(new MyProcessor()).stop();
rest("/test")
.get("/error")
.route()
.bean(MyClassRaiseException.class, "test");
}
}
public MyClassRaiseException {
public void test() {
throws new RuntimeException("TEST");
}
}
public MyProcessor implements Processor {
public void process(Exchange exchange) throws Exception {
System.out.println("This line of code is not executed");
}
}
MyProcessor is not called. Helps are needed please!!