Hi,
Using the following snippet of Java DSL, I define a "global" error handling
policy and two exception-specific policies. The global policy handles any
error case not covered by the exception policies:
errorHandler(deadLetterChannel("dlc-endpoint").maximumRedeliveries(2));
exception(java.lang.Exception).to("default-exception-handler-endpoint");
exception(java.lang.ArithmeticException).to("specific-exception-handler-endpoint");
from("some-endpoint").handleFault().to("another-endpoint");
Works great but I'd like to represent it in XML. I'm down with the DLC
configuration but can't figure out how to define exception-specific
error handling:
<bean id="myRedeliveryPolicy"
class="org.apache.camel.processor.RedeliveryPolicy">
<property name="maximumRedeliveries" value="2" />
</bean>
<bean id="myDLCHandler"
class="org.apache.camel.builder.DeadLetterChannelBuilder">
<property name="redeliveryPolicy" ref="myRedeliveryPolicy" />
<property name="defaultDeadLetterEndpointUri" value="dlc-endpoint"/>
</bean>
<camelContext id="camel" >
<route errorHandlerRef="myDLCHandler" >
<from uri="some-endpoint" />
<to uri="another-endpoint" />
</route>
</camelContext>
How can I configure both a general DLC and exception-specific error
handling?
Thanks, Garry
--
View this message in context:
http://www.nabble.com/How-to-specify-exception-handling-policy-in-XML--tp19309362s22882p19309362.html
Sent from the Camel - Users mailing list archive at Nabble.com.