You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "George Daswani (JIRA)" <ji...@apache.org> on 2019/06/13 02:17:00 UTC

[jira] [Created] (CAMEL-13640) Camel Split with Aggregate, calling subroute with onException (handled = true) stops, doesn't work the same way as calling a sub route using doTry

George Daswani created CAMEL-13640:
--------------------------------------

             Summary: Camel Split with Aggregate, calling subroute with onException (handled = true) stops, doesn't work the same way as calling a sub route using doTry 
                 Key: CAMEL-13640
                 URL: https://issues.apache.org/jira/browse/CAMEL-13640
             Project: Camel
          Issue Type: Bug
          Components: camel-core
    Affects Versions: 2.24.0
            Reporter: George Daswani
         Attachments: BugReport.zip

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 [forums|http://camel.465427.n5.nabble.com/endDoTry-problem-td5543541.html]



Sample program attached (maven project) - BugReport.zip

 
{code:java}
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");
}{code}
 



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)