Hi
I am trying to use the Retry-Feature (added in 2.4.4).
Client is configured like this:
<bean id="retryStrategy" class="org.apache.cxf.clustering.RetryStrategy">
<property name="maxNumberOfRetries" value="5"/>
<property name="delayBetweenRetries" value="7000"/>
</bean>
<jaxws:client id="someService"
serviceClass="someClass">
<jaxws:features>
<clustering:failover>
<clustering:strategy>
<ref bean="retryStrategy"/>
</clustering:strategy>
</clustering:failover>
</jaxws:features>
</jaxws:client>
The idea may be an automatic retry if an IOException occurs (timeout,
Connection refused
or similar).
Note, that we don't use any alternate Addresses in the Strategy (we set the
address before invocation):
BindingProvider bp = (BindingProvider) port;
bp.getRequestContext().put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY,
props.getEndpointAddress());
With this Setup (and if we set the address to some inaccessible url)
the retryStrategy is only invoked once
and stops after one iteration:
WARN - AbstractStaticFailoverStrategy.selectAlternateEndpoint(115) |
no alternate targets remain => giving up on failover
Since we need also some Businesslogic within the Retry-Feature (which
per se is not threadsafe), i'd like
to know, if there are other ways of doing this (Perhaps a
retryInterceptor)? If so, a short example may be highly
appreciated
regards
Ben