...
Camel supports pluggable ErrorHandler strategies to deal with errors processing an Event Driven Consumer. An alternative is to specify the error handling directly in the DSL using the Exception Clause.
For introduction and background material see Error handling in Camel.
Info | ||
---|---|---|
| ||
In Camel 2.0 onwards there default error handler is changed from Dead Letter Channel to DefaultErrorHandler. This error handler does not support a dead letter queue and will return exceptions back to the caller. This is what you expects when working with regular Java that exceptions will be thrown back to the caller. This error handler supports a limited set of features. |
Tip | ||
---|---|---|
| ||
Using Error Handler combined with Exception Clause is a very powerful ally. We encourage end-users to use this combination in your error handling strategies. See samples and Exception Clause. |
The current implementations Camel provides out of the box are:Some current implementations include
Non transacted
- DefaultErrorHandler is the default error handler in Camel 2.0 onwards. This error handler does not support a deal letter queue, it will propagate exceptions back to the caller, as if there where no error handler at all. It has a limited set of features.
- 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
- NoErrorHandler for no error handling
...
- TransactionErrorHandler is the default error handler in Camel 2.0 onwards for transacted routes. This error handler does not support a deal letter queue, it will propagate exceptions back to the caller, as if there where no error handler at all. It has a limited set of features.
- Transaction for transactional error handling (Spring based). See the Transactional Client EIP pattern.
Info | ||
---|---|---|
| ||
In Camel 2.0 onwards there default error handler is changed from Dead Letter Channel to DefaultErrorHandler. This error handler does not support a dead letter queue and will return exceptions back to the caller. This is what you expects when working with regular Java that exceptions will be thrown back to the caller. This error handler supports a limited set of features. |
Tip | ||
---|---|---|
| ||
For introduction and background material see Error handling in Camel. |
...
title | Exception Clause |
---|
...
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 examples. Error handling rules are inherited on each routing rule within a single RouteBuilder
Note | ||
---|---|---|
| ||
If the route is transactional then the Dead Letter Channel is disabled. The |
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 examples. Error handling rules are inherited on each routing rule within a single RouteBuilder
Short Summary of the provided Error Handlers
...
The TransactionErrorHandler is the new default error handler in Camel 2.0 for transacted routes. It only supports a limited set of features such as catching exception and using the Exception Clause. It does not support redelivery, delays or the likes. It will propagate exceptions back to the original caller. It does not have any dead letter queue.
Tip | ||||
---|---|---|---|---|
| ||||
If you have marked a route as transacted using the transacted DSL then Camel will automatic use a TransactedErrorHandler. It will try to lookup the global/per route configured error handler and use it if its a |
Scopes
The error handler is scoped as either
...