Marking exceptions as handled
The default behavior for Camel is to call your exception (or error) handler, and rethrow the exception to the caller. This recipe will show how to mark that exception as handled, which tells Camel that it should not consider this to be an error and nothing further needs to be done, that is, do not rethrow that particular exception to the consuming endpoint.
Getting ready
The Java code for this recipe is located in the org.camelcookbook.error.exception
package. The Spring XML files are located under src/main/resources/META-INF/spring
and prefixed with exception
.
How to do it...
Within the onException
DSL statement, specify a handled
statement with a predicate that will indicate if the exception has been handled (predicate ...
Get Apache Camel Developer's Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.