camel-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Claus Ibsen (JIRA)" <j...@apache.org>
Subject [jira] [Resolved] (CAMEL-5570) maximumRedeliveries is inherited for other exceptions thrown while redelivering with maximumRedeliveries(-1)
Date Wed, 05 Sep 2012 13:54:07 GMT

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

Claus Ibsen resolved CAMEL-5570.
--------------------------------

    Resolution: Fixed
    
> 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
>            Reporter: Øyvind Ingebrigtsen Øvergaard
>            Assignee: Claus Ibsen
>            Priority: Minor
>             Fix For: 2.9.4, 2.11.0, 2.10.2
>
>         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

Mime
View raw message