About moving Exchange to dead letter queue and using handled - 6.3

Talend ESB Mediation Developer Guide

EnrichVersion
6.3
EnrichProdName
Talend Data Fabric
Talend Data Services Platform
Talend ESB
Talend MDM Platform
Talend Open Studio for ESB
Talend Real-Time Big Data Platform
task
Design and Development
EnrichPlatform
Talend ESB

When all attempts of redelivery have failed the Exchange is moved to the dead letter queue (the dead letter endpoint). The exchange is then complete and from the client point of view it was processed. With this process the Dead Letter Channel has handled the Exchange.

For instance configuring the dead letter channel, using the fluent builders:

errorHandler(deadLetterChannel("jms:queue:dead")
    .maximumRedeliveries(3).redeliverDelay(5000));

Using Spring XML Extensions:

<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 setException(null), by moving the caused exception to a property on the Exchange, with the key Exchange.EXCEPTION_CAUGHT. Then the exchange is moved to the jms:queue:dead destination and the client will not notice the failure.