...
Code Block | ||||
---|---|---|---|---|
| ||||
onException(ValidationException.class). to("activemq:validationFailed"); onException(ShipOrderException.class). to("activemq:shipFailed"); from("seda:order").to("bean:processOrder"); |
Number of features depend on Error Handler being used
The Exception Clause supports a wide range of features, that are dependent on the Error Handler used. For instance Dead Letter Channel supports it all, where as the DefaultErrorHandler and TransactionErrorHandler doe not support anything related to redelivery.
Here is a breakdown of which features is supported by the Error Handler(s):
Feature | Supported by the following Error Handler |
---|---|
all scopes | DefaultErrorHandler, TransactionErrorHandler, Dead Letter Channel |
onException | DefaultErrorHandler, TransactionErrorHandler, Dead Letter Channel |
onWhen | DefaultErrorHandler, TransactionErrorHandler, Dead Letter Channel |
handled | DefaultErrorHandler, TransactionErrorHandler, Dead Letter Channel |
Custom ExceptionPolicy | DefaultErrorHandler, TransactionErrorHandler, Dead Letter Channel |
dead letter queue | Dead Letter Channel. Dead letter queue is known as failure processor inside Camel. |
redeliverUntil | |
onRedelivery | |
Scopes
Exception clauses is scoped as either:
...
Configuring ReliveryPolicy (redeliver options)
RedeliveryPolicy requires to use the Dead Letter Channel as the Error Handler.
The default error handler used in Camel is the Dead Letter Channel which supports attempting to redeliver the message exchange a number of times before sending it to a dead letter endpoint. See Dead Letter Channel for further information about redeliver and which redeliver options exists.
...