Uploaded image for project: 'Camel'
  1. Camel
  2. 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

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Resolved
    • Minor
    • Resolution: Not A Problem
    • 2.24.0
    • Future
    • camel-core
    • 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");
      }

       

      Attachments

        1. BugReport.zip
          5 kB
          George Daswani

        Activity

          People

            davsclaus Claus Ibsen
            gdaswani George Daswani
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: