Hi
On 03/01/12 13:30, Ben Pezzei wrote:
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());


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 ?

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

Cheers, Sergey

regards
Ben


--
Sergey Beryozkin

Talend Community Coders
http://coders.talend.com/

Blog: http://sberyozkin.blogspot.com

Reply via email to