You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by japearson <ja...@agiledigital.com.au> on 2015/08/11 06:04:34 UTC

Use RetryStrategy programatically?

Hi,

I'm wondering if it's possible to use the  RetryStrategy
<https://github.com/apache/cxf/blob/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java>  
programatically by configuring properties on the port?

We don't use spring, and we would like to be able to configure the http
conduit to retry a specified number of times on a socket exception for
example.

Thanks,

Joel



--
View this message in context: http://cxf.547215.n5.nabble.com/Use-RetryStrategy-programatically-tp5759944.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Use RetryStrategy programatically?

Posted by japearson <ja...@agiledigital.com.au>.
Sergey Beryozkin wrote
> I think if you use JAXWS then you need to cast a 
> proxy to CXF Client and set a feature on it 

Thanks Sergey,

Took a little while to figure out how to set a feature on a client as the
features set themselves on the client instead of the client setting
features, but was pretty simple in the end:

        RetryStrategy retryStrategy = new RetryStrategy();
        retryStrategy.setMaxNumberOfRetries(5);
        FailoverFeature failoverFeature = new FailoverFeature();
        failoverFeature.setStrategy(retryStrategy);
        failoverFeature.initialize(client, client.getBus());



--
View this message in context: http://cxf.547215.n5.nabble.com/Use-RetryStrategy-programatically-tp5759944p5759962.html
Sent from the cxf-user mailing list archive at Nabble.com.

Re: Use RetryStrategy programatically?

Posted by Sergey Beryozkin <sb...@gmail.com>.
Hi, sure you can register a failover feature initialized with a retry 
strategy with a client, I think if you use JAXWS then you need to cast a 
proxy to CXF Client and set a feature on it (or may be via 
JaxwsCkientFactoryBean), if it is RS then pass this feature to a proxy 
factory or WebClient constructor

HTH
Sergey
On 11/08/15 05:04, japearson wrote:
> Hi,
>
> I'm wondering if it's possible to use the  RetryStrategy
> <https://github.com/apache/cxf/blob/2.7.x-fixes/rt/features/clustering/src/main/java/org/apache/cxf/clustering/RetryStrategy.java>
> programatically by configuring properties on the port?
>
> We don't use spring, and we would like to be able to configure the http
> conduit to retry a specified number of times on a socket exception for
> example.
>
> Thanks,
>
> Joel
>
>
>
> --
> View this message in context: http://cxf.547215.n5.nabble.com/Use-RetryStrategy-programatically-tp5759944.html
> Sent from the cxf-user mailing list archive at Nabble.com.
>