...
- how many times a message is attempted to be redelivered before it is considered a failure and sent to the dead letter channel
- the initial redelivery timeout
- whether or not exponential backoff is used (i.e. the time between retries increases using a backoff multiplier)
- whether to use collision avoidance to add some randomness to the timings
- delay pattern (see below for details)
- Camel 2.11: whether to allow redelivery during stopping/shutdown
Once all attempts at redelivering the message fails then the message is forwarded to the dead letter queue.
...
Now suppose the route above and a failure happens in the foo
bean. Then the Exchange.TO_ENDPOINT
and Exchange.FAILURE_ENDPOINT
will still contain the value of http://someserver/somepath
.
Control if redelivery is allowed during stopping/shutdown
Available as of Camel 2.11
In Camel 2.10 or earlier, Camel will perform redelivery while stopping a route, or shutting down Camel. This has improved a bit in Camel 2.10 onwards, as Camel will not perform redelivery attempts when shutting down aggressively (eg during Graceful Shutdown and timeout hit). From Camel 2.11 onwards there is a new option redeliverWhileStopping
which you can use to control if redelivery is allowed or not.
The default value is true
to be backwards compatible as before. For example the following sample shows how to do this with Java DSL and XML DSL
Wiki Markup |
---|
{snippet:id=e1|lang=java|url=camel/trunk/camel-core/src/test/java/org/apache/camel/processor/RedeliveryErrorHandlerNoRedeliveryOnShutdownTest.java} |
And the sample sample with XML DSL
Wiki Markup |
---|
{snippet:id=e1|lang=xml|url=camel/trunk/components/camel-spring/src/test/resources/org/apache/camel/spring/processor/SpringRedeliveryErrorHandlerNoRedeliveryOnShutdownTest.xml} |
Samples
The following example shows how to configure the Dead Letter Channel configuration using the DSL
...