Details
-
Bug
-
Status: Resolved
-
Minor
-
Resolution: Not A Problem
-
2.24.0
-
None
-
Unknown
Description
Split with Aggregate calling a sub route that has handled exception (eq. direct:exceptionStart) doesn't behave the same as one calling a sub route swallowing exceptions using doTry (eq. direct:doTryStart)
The two should be functionally equivalent but the one calling the sub route with onException stops prematurely. It never gets to ".log("done with split and aggregate").
Others have reported the same thing on the camel-users list - for example
Sample program attached (maven project) - BugReport.zip
public void configure() throws Exception { from("direct:exceptionStart").routeId("exceptionStart").split(body(), new MyAggregationStrategy()) .to("direct:processItemOnException").end().log("done with split and aggregate"); from("direct:processItemOnException").routeId("processItemOnException").onException(Exception.class) .handled(true).end().log("${body}").throwException(new Exception("an Error!")); from("direct:doTryStart").routeId("doTryStart").split(body(), new MyAggregationStrategy()) .to("direct:processItemOnDoTry").end().log("done with split and aggregate"); from("direct:processItemOnDoTry").routeId("processItemOnDoTry").doTry().log("${body}") .throwException(new Exception("an Error!")).endDoTry().doCatch(Exception.class) .log("swallowed exception"); }