Hi all,
I play with Exception, ErrorHandler and redelivery (Camel 2.0-M1) and there
are some things that I can't understand :confused:.
snippet code
<bean id="globalDeadLetterChannel"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="defaultDeadLetterEndpointUri"
value="direct:response"/>
<property name="onRedelivery" ref="routeRedelivery"/>
<property name="redeliveryPolicy">
<bean id="redeliveryPolicyConfig"
class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="1"/>
</bean>
</property>
</bean>
<camelContext id="camelContext" errorHandlerRef="globalDeadLetterChannel"
xmlns="http://camel.apache.org/schema/spring">
<onException >
<exception>java.lang.RuntimeException</exception>
<handled>
<constant>true</constant>
</handled>
<to uri="direct:response" />
</onException>
… other routes …
</camelContext>
routeRedelivery bean is a processor which make some trace in a log file.
When I raise a runtimeException, the process method of routeRedelivery bean
is not called. I can't understand why, since onRedelivery property is
defined for my global dead letter channel.
If I modify onException element like following:
<onException onRedeliveryRef="routeRedelivery">
<exception>java.lang.RuntimeException</exception>
<redeliveryPolicy maximumRedeliveries="1"/>
<handled>
<constant>true</constant>
</handled>
<to uri="direct:response" />
</onException>
And I raised a RuntimeException, I have some trace in my log file that
proves that process method of routeRedelivery bean is called.
Is someone can explain me why onRedelivery processor is not called when it's
defined in global scope will be appreciated.
Best regards,
Mta38
--
View this message in context:
http://www.nabble.com/Exception%2C-ErrorHandler-and-redelivery-tp23743717p23743717.html
Sent from the Camel - Users mailing list archive at Nabble.com.