You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by greenbean <Ke...@ngc.com> on 2008/08/11 16:51:58 UTC

ExceptionPolicyStrategy In Spring XML

Can someone give me an example of configuring an ExceptionPolicyStrategy in
Spring XML?  I see the example below on the web.  However, I am not sure how
that translates to Spring XML.

exception(NullPointerException.class)
    .maximumRedeliveries(1)
    .setHeader(MESSAGE_INFO, constant("Damm a NPE"))
    .to(ERROR_QUEUE);

exception(IOException.class)
    .initialRedeliveryDelay(5000L)
    .maximumRedeliveries(3)
    .backOffMultiplier(1.0)
    .useExponentialBackOff()
    .setHeader(MESSAGE_INFO, constant("Damm somekind of IO exception"))
    .to(ERROR_QUEUE);

exception(Exception.class)
    .initialRedeliveryDelay(1000L)
    .maximumRedeliveries(2)
    .setHeader(MESSAGE_INFO, constant("Damm just exception"))
    .to(ERROR_QUEUE);

Thanks
-- 
View this message in context: http://www.nabble.com/ExceptionPolicyStrategy-In-Spring-XML-tp18927372s22882p18927372.html
Sent from the Camel - Users mailing list archive at Nabble.com.


RE: ExceptionPolicyStrategy In Spring XML

Posted by Claus Ibsen <ci...@silverbullet.dk>.
Hi

To my knowledge not all the Java DSL has been fully ported to Spring XML.
So maybe you can do all the full fledged exception stuff in Spring XML.

But I am sure we will add it. Especially when end-users need it.
Good you have created the JIRA for it.


Med venlig hilsen
 
Claus Ibsen
......................................
Silverbullet
Skovsgårdsvænget 21
8362 Hørning
Tlf. +45 2962 7576
Web: www.silverbullet.dk

-----Original Message-----
From: greenbean [mailto:Kevin.Urciolo@ngc.com] 
Sent: 11. august 2008 21:49
To: camel-user@activemq.apache.org
Subject: Re: ExceptionPolicyStrategy In Spring XML


I created this issue and suggest a trivial patch.  However, I don't know if
this is the best way to accomplish setting exceptions via Spring xml.

https://issues.apache.org/activemq/browse/CAMEL-813


greenbean wrote:
> 
> Can someone give me an example of configuring an ExceptionPolicyStrategy
> in Spring XML?  I see the example below on the web.  However, I am not
> sure how that translates to Spring XML.
> 
> exception(NullPointerException.class)
>     .maximumRedeliveries(1)
>     .setHeader(MESSAGE_INFO, constant("Damm a NPE"))
>     .to(ERROR_QUEUE);
> 
> exception(IOException.class)
>     .initialRedeliveryDelay(5000L)
>     .maximumRedeliveries(3)
>     .backOffMultiplier(1.0)
>     .useExponentialBackOff()
>     .setHeader(MESSAGE_INFO, constant("Damm somekind of IO exception"))
>     .to(ERROR_QUEUE);
> 
> exception(Exception.class)
>     .initialRedeliveryDelay(1000L)
>     .maximumRedeliveries(2)
>     .setHeader(MESSAGE_INFO, constant("Damm just exception"))
>     .to(ERROR_QUEUE);
> 
> Thanks
> 

-- 
View this message in context: http://www.nabble.com/ExceptionPolicyStrategy-In-Spring-XML-tp18927372s22882p18932363.html
Sent from the Camel - Users mailing list archive at Nabble.com.


Re: ExceptionPolicyStrategy In Spring XML

Posted by greenbean <Ke...@ngc.com>.
I created this issue and suggest a trivial patch.  However, I don't know if
this is the best way to accomplish setting exceptions via Spring xml.

https://issues.apache.org/activemq/browse/CAMEL-813


greenbean wrote:
> 
> Can someone give me an example of configuring an ExceptionPolicyStrategy
> in Spring XML?  I see the example below on the web.  However, I am not
> sure how that translates to Spring XML.
> 
> exception(NullPointerException.class)
>     .maximumRedeliveries(1)
>     .setHeader(MESSAGE_INFO, constant("Damm a NPE"))
>     .to(ERROR_QUEUE);
> 
> exception(IOException.class)
>     .initialRedeliveryDelay(5000L)
>     .maximumRedeliveries(3)
>     .backOffMultiplier(1.0)
>     .useExponentialBackOff()
>     .setHeader(MESSAGE_INFO, constant("Damm somekind of IO exception"))
>     .to(ERROR_QUEUE);
> 
> exception(Exception.class)
>     .initialRedeliveryDelay(1000L)
>     .maximumRedeliveries(2)
>     .setHeader(MESSAGE_INFO, constant("Damm just exception"))
>     .to(ERROR_QUEUE);
> 
> Thanks
> 

-- 
View this message in context: http://www.nabble.com/ExceptionPolicyStrategy-In-Spring-XML-tp18927372s22882p18932363.html
Sent from the Camel - Users mailing list archive at Nabble.com.