camel-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen" ...@silverbullet.dk>
Subject RE: How to specify exception handling policy in XML?
Date Thu, 04 Sep 2008 18:25:47 GMT
Hi Gary

My mail editor has a spring XML editor but I think you can use the <onException> xml
tag to configure these exception types.



Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk
-----Original Message-----
From: Garry [mailto:gmbroth@hotmail.com] 
Sent: 4. september 2008 16:26
To: camel-user@activemq.apache.org
Subject: How to specify exception handling policy in XML?


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.


Mime
View raw message