You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 5 Next »

Error Handler

Camel supports pluggable ErrorHandler strategies to deal with errors processing an Event Driven Consumer. Some current implementations include

  • Dead Letter Channel which supports attempting to redeliver the message exchange a number of times before sending it to a dead letter endpoint
  • LoggingErrorHandler for just catching and logging exceptions

These error handlers can be applied in the DSL to an entire set of rules or a specific routing rule as we show in the next examlpes.

Setting global error handlers

The following example shows how you can register a global error handler (in this case using the logging handler)

Error formatting macro: snippet: java.lang.NullPointerException

Setting error handlers on a specific route

The following example shows how you can register a local error handler; the customized logging handler is only registered for the route from Endpoint queue:a

Error formatting macro: snippet: java.lang.NullPointerException

Default Error Handler

The default error handler is the Dead Letter Channel which is automatically configured for you. You can then configure the specific dead letter endpoint to use either for an entire rule base or a specific rule as shown above.

  • No labels