Error handler features
Basically, all error handlers extend the DefaultErrorHandler
. The DefaultErrorHandler
provides a set of interesting features allowing you to use very fine-grained management of the exceptions.
Redelivery
The DefaultErrorHandler
(and so the DeadLetterErrorHandler
and TransactedErrorHandler
) supports a redelivery mechanism that you can configure via a redelivery policy.
For instance, the following Blueprint XML creates a Camel route that systematically throws an IllegalArgumentException
(with Booooommmmm
message). As we don't explicitly define an error handler, the route uses the DefaultErrorHandler
. We just configure the redelivery policy of the DefaultErrorHandler
, trying to redeliver the message three times, waiting two seconds between each attempt. If it still fails at the fourth attempt, the exchange ends and the exception is sent to the caller.
<?xml version="1.0" encoding="UTF-8"?> <blueprint xmlns="http://www.osgi.org/xmlns/blueprint/v1.0.0"> <bean...