You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Øyvind Ingebrigtsen Øvergaard (JIRA)" <ji...@apache.org> on 2012/09/05 11:09:08 UTC

[jira] [Updated] (CAMEL-5570) maximumRedeliveries is inherited for other exceptions thrown while redelivering with maximumRedeliveries(-1)

     [ https://issues.apache.org/jira/browse/CAMEL-5570?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Øyvind Ingebrigtsen Øvergaard updated CAMEL-5570:
-------------------------------------------------

    Patch Info: Patch Available
    
> maximumRedeliveries is inherited for other exceptions thrown while redelivering with maximumRedeliveries(-1)
> ------------------------------------------------------------------------------------------------------------
>
>                 Key: CAMEL-5570
>                 URL: https://issues.apache.org/jira/browse/CAMEL-5570
>             Project: Camel
>          Issue Type: Bug
>          Components: camel-core
>    Affects Versions: 2.9.0, 2.10.0, Future
>            Reporter: Øyvind Ingebrigtsen Øvergaard
>         Attachments: redeliverypolicy-on-exception-while-redelivering-fix.patch, redeliverypolicy-on-exception-while-redelivering-test.patch
>
>
> Given a route:
> {code}
> from("direct:source")
>    .onException(FirstException.class)
>          .handled(true)
>          .maximumRedeliveries(-1)
>     .end()
>     .onException(SecondException.class)
>         .handled(true)
>         .to("direct:error")
>     .end()
>     .to("direct:destination");
> {code}
> If the consumer of direct:destination throws a FirstException, the message will be redelivered. Now if a SecondException is thrown while redelivering the message to direct:destination, it does NOT go to direct:error, as you would expect, but is redelivered again; using the same RedeliveryPolicy as for FirstException.
> I have attached a test that illustrates this.
> In OnExceptionDefinition.createRedeliveryPolicy, maximumRedeliveries is set to 0 if the OnExceptionDefinition has outputs and the parent RedeliveryPolicy has explicitly set maximumRedeliveries > 0. The latter check fails when maximumRedeliveries is -1 (infinite retries), and the parent RedeliveryPolicy is returned.
> I have attached a patch that ensures that we don't inherit the parent maximumRedeliveries even if it is set to -1.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira