Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: added example Spring DSL (for CAMEL-3557)

...

For instance configuring the dead letter channel as:

Using the Fluent Builders

Code Block
java
java
errorHandler(deadLetterChannel("jms:queue:dead")
    .maximumRedeliveries(3).redeliverDealyredeliveryDelay(5000));

Using the Spring XML Extensions

Code Block
xml
xml

<route errorHandlerRef="myDeadLetterErrorHandler">
   ...
</route>

<bean id="myDeadLetterErrorHandler" class="org.apache.camel.builder.DeadLetterChannelBuilder">
    <property name="deadLetterUri" value="jms:queue:dead"/>
    <property name="redeliveryPolicy" ref="myRedeliveryPolicyConfig"/>
</bean>

<bean id="myRedeliveryPolicyConfig" class="org.apache.camel.processor.RedeliveryPolicy">
    <property name="maximumRedeliveries" value="3"/>
    <property name="redeliveryDelay" value="5000"/>
</bean>

The Dead Letter Channel above will clear the caused exception when the Exchange is moved to the jms:queue:dead destination and the client will not notice the failure.

...