O'Reilly logo

Mastering Apache Camel by Jean-Baptiste Onofré

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

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 ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required