camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ritterda <daniel.rit...@sap.com>
Subject Catch-All for (Sub-) Route Exception Handling
Date Fri, 15 Apr 2016 10:23:13 GMT
Hello, 

I am analyzing the exception handling capabilities of Apache Camel (v2.16.x)
and was wondering whether it is possible to propagate exceptions from a
subroute (B; e.g., "from:direct") to the calling route (A; e.g.,
"to:direct") without setting ".errorHandler(noErrorHandler())".

A: from(..).onException(IOException.class)...process().to(direct:subroute);

B:
from(direct:subroute).*errorHandler(noErrorHandler())*.process(fails).to(..);

The noErrorHandler flag on a subroute level disables all error handlers
(e.g., global TransactionErrorHandler, DefaultErrorHandler). As a result the
exception is propagated to the calling route (A). As suggested in many
forums, this works fine, i.e., the exception is caught by the onException
clause for further processing. However, if error handlers are required, the
noErrorHandler cannot be set, which does not propagate the exception.

Do you know a way how to ensure the described behavior? Thank you in
advance.

Best Regards,
Daniel Ritter







--
View this message in context: http://camel.465427.n5.nabble.com/Catch-All-for-Sub-Route-Exception-Handling-tp5781154.html
Sent from the Camel - Users mailing list archive at Nabble.com.

Mime
View raw message