let's give it a try here too... 😉 thx in advance your help.
Zoltan -----Original Message----- Sent: Tuesday, February 9, 2021 12:56 PM To: iss...@camel.apache.org Subject: [3.7.0] Issue with exception handling - predicates... Hello, We are in the middle of moving from camel version 2.22.1 to 3.7.0 and encountered a changed behaviour, which we are unsure whether is a new feature or an unwanted bug. In previous releases (versions prior to 3.5.0) when routes had the noErrorHandler() error handling configured, it simply let the calling routes handle the errors no matter where they originated from. In most cases it is still true, but we noticed that in case of predicates, with newer releases the otherwise branch gets executed before the error handling happens. After some investigation we narrowed down the call chain to this point in ChoiceProcessor: https://github.com/apache/camel/blob/camel-3.7.2/core/camel-core-processor/src/main/java/org/apache/camel/processor/ChoiceProcessor.java#L99 that was changed in 3.5.0 with commit https://github.com/apache/camel/commit/a8bdd194e325dffd879303e02df7c2226e152883 Is this an intended change, should we prepare from now on that this is how it's going to work, or is this a side effect of some other change? Looking at the repo it seems there were no unit tests that tried to cover this functionality, so we're unsure whether this change is on purpose, also the migration guides did not mention it. Furthermore, after some more testing it seems only the next step of the chain is invoked right after the otherwise, e.g.: from("scheduler://in?delay=50000&initialDelay=5000").routeId("Ingress") .onException(Exception.class) /* -- */.process((exchange)-> {System.out.println("OUTER ONEXCEPTION");}) .end() .to(ExchangePattern.InOut, "direct:in") .process((exchange) -> {System.out.println("ORIGINAL ROUTE END");}); from("direct:in").routeId("MAIN") .errorHandler(noErrorHandler()) .choice() .when(new Predicate() { @Override public boolean matches(Exchange exchange) { throw new UnsupportedOperationException("Not supported yet."); } }) /* -- */.process((exchange) -> {System.out.println("PROCESSED");}) .otherwise() /* -- */.process((exchange) -> {System.out.println("FIRST OTHERWISE");}) /* -- */.process((exchange) -> {System.out.println("SECOND OTHERWISE");}) .end(); this would print out FIRST OTHERWISE1 OUTER ONEXCEPTION If it is a bug, not a feature, feel free to create relevant Jira issue. Thank you for the clarification and/or support! Zoltan