You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@camel.apache.org by vmasina <vi...@intraisp.com> on 2008/05/19 16:58:39 UTC
Retry based on bean method invocation response
Is it possible to set retry policy based on response from method invocation
on a bean?
I am able to set the retry policy based on exception thrown by a bean
invocation. Please advice on how to achieve the same retry support based on
response from the bean method invocation.
--
View this message in context: http://www.nabble.com/Retry-based-on-bean-method-invocation-response-tp17317282s22882p17317282.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retry based on bean method invocation response
Posted by vmasina <vi...@intraisp.com>.
With this approach I will not be getting the same support of
DeadLetterChannel.
Gert Vanthienen wrote:
>
> L.S.,
>
> Re-reading your question once more, I think my previous answer is
> completely off track... You want to retry an operation *without* ever
> encountering an exception, right? You could do that with a
> content-based-router, something along these lines...
> from("direct:a").to("bean:...").choice().when(/*check outcome
> here*/).to("direct:a").otherwise().to("direct:b");
>
> In the future, you might be able to achieve something similar with loop
> operations in the DSL (cfr.
> https://issues.apache.org/activemq/browse/CAMEL-325). Does this answer
> your question?
>
> Gert
>
> Gert Vanthienen wrote:
>> L.S.,
>>
>> I think you should be able to this by implementing your own
>> RedeliveryPolicy and plugging it in to the DeadLetterChannel. Just
>> override the shouldRedeliver() method and call anything you want in
>> there to determine what to do.
>>
>> Gert
>>
>> vmasina wrote:
>>> Is it possible to set retry policy based on response from method
>>> invocation
>>> on a bean?
>>>
>>> I am able to set the retry policy based on exception thrown by a bean
>>> invocation. Please advice on how to achieve the same retry support
>>> based on
>>> response from the bean method invocation.
>>>
>>>
>>>
>>
>>
>
>
>
> -----
> ---
> Gert Vanthienen
> http://www.anova.be
>
--
View this message in context: http://www.nabble.com/Retry-based-on-bean-method-invocation-response-tp17317282s22882p17344084.html
Sent from the Camel - Users mailing list archive at Nabble.com.
Re: Retry based on bean method invocation response
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
Re-reading your question once more, I think my previous answer is
completely off track... You want to retry an operation *without* ever
encountering an exception, right? You could do that with a
content-based-router, something along these lines...
from("direct:a").to("bean:...").choice().when(/*check outcome
here*/).to("direct:a").otherwise().to("direct:b");
In the future, you might be able to achieve something similar with loop
operations in the DSL (cfr.
https://issues.apache.org/activemq/browse/CAMEL-325). Does this answer
your question?
Gert
Gert Vanthienen wrote:
> L.S.,
>
> I think you should be able to this by implementing your own
> RedeliveryPolicy and plugging it in to the DeadLetterChannel. Just
> override the shouldRedeliver() method and call anything you want in
> there to determine what to do.
>
> Gert
>
> vmasina wrote:
>> Is it possible to set retry policy based on response from method
>> invocation
>> on a bean?
>>
>> I am able to set the retry policy based on exception thrown by a bean
>> invocation. Please advice on how to achieve the same retry support
>> based on
>> response from the bean method invocation.
>>
>>
>>
>
>
Re: Retry based on bean method invocation response
Posted by Gert Vanthienen <ge...@skynet.be>.
L.S.,
I think you should be able to this by implementing your own
RedeliveryPolicy and plugging it in to the DeadLetterChannel. Just
override the shouldRedeliver() method and call anything you want in
there to determine what to do.
Gert
vmasina wrote:
> Is it possible to set retry policy based on response from method invocation
> on a bean?
>
> I am able to set the retry policy based on exception thrown by a bean
> invocation. Please advice on how to achieve the same retry support based on
> response from the bean method invocation.
>
>
>