Hi
On 09/01/12 12:43, Ben Pezzei wrote:
Hi
2012/1/4 Sergey Beryozkin<[email protected]>:
May be there's a bug in the FailoverTargetSelector's logic when the
addresses are specified like this, I looked at the code and I'm not what is
going on there, can you please experiment with setting this same
(alternative) address in the strategy bean ?
Well, it looks like a bug
Since, we have multiple clients, which should retry a service, the
code looks like this:
FailoverFeature failoverFeature = new FailoverFeature();
RetryStrategy failoverStrategy = new RetryStrategy();
List<String> alternateAddress=new ArrayList<String>();
alternateAddress.add(props.getEndpointAddress());
failoverStrategy.setAlternateAddresses(alternateAddress);
failoverStrategy.setMaxNumberOfRetries(5);
failoverStrategy.setDelayBetweenRetries(2000);
failoverFeature.setStrategy(failoverStrategy);
failoverFeature.initialize(client,client.getBus());
where client is created by:
Client client = ClientProxy.getClient(port);
and port is the created by spring with<jaxws:client...>
With this setup, the situation is like before (service is invoked twice).
If an additional alternateAddress is added
alternateAddress.add(props.getEndpointAddress());
the service is invoked 3times (1 failure, 2 retries), so it looks like
that maxNumberOfRetries is ignored, and the list alternateAddresses
is iterated.
I fixed it for 2.5.x/2.4.x & the trunk, I think it should work now for
Endpoints (your original approach) too, but I was only able to add a
JAX-RS test for alternate addresses; was not easy to update the
SOAP-based test with WSDLs, but the failover feature is applied the same
way irrespectively of the frontend, so this single test should be ok,
give it a try please.
I think may be we should actually add a DelegatingRetryStrategy which
would work with whatever strategy is actually used to select the
alternate endpoints/addresses; guess can be done a bit later
So the question remains, how to build an outFaultInterceptor which
retries (resets the chain?), since we won't/can't upgrade to a possible
patched cxf-release (or manually patch the sources)
If you can not move to the latest CXFs then consider extending
RetryStrategy and override getNextAlternate the same way it is done on
the trunk and set the custom strategy on the FailoverFeature
Cheers, Sergey
tnx& regards
Ben
--
Sergey Beryozkin
Talend Community Coders
http://coders.talend.com/
Blog: http://sberyozkin.blogspot.com