Open nickmza opened 1 year ago
this worked perfectly, thank you so much appreciate the speedy response and effort on this.
I tried to write a test where a number format exception happens I was trying to verify if the test would go into the onexception section and that seems to have worked fine
@Test
public void error() throws Exception {
AdviceWith.adviceWith(camelContext,
"simple-rest",
rb -> rb.replaceFromWith("direct:file:start"));
AdviceWith.adviceWith(camelContext,
"simple-rest",
rb -> rb.weaveByToUri("https://en1gvb5qo7vg4.x.pipedream.net")
.replace()
.throwException(new NumberFormatException()));
camelContext.start();
producerTemplate.sendBody("direct:file:start", "Hello");
}
on the simpleRestRoute all I added was a catch to handle the number format exception
onException(NumberFormatException.class)
.handled(true)
.log("Dummy Number Format");
think I have a much better understanding now
https://nickmck.net/2023/05/18/camel-simple/