[ 
https://issues.apache.org/jira/browse/CXF-5745?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14004578#comment-14004578
 ] 

Sergey Beryozkin commented on CXF-5745:
---------------------------------------

Hi,

Sure, Xilai provided a good extension - and this is what one should do, 
customize it,  whenever a default approach does not work.
I'd have no problems with copying a primary URI to the list as opposed to 
writing the extension code but it is up to a user in the end of the day how to 
do it.

> I still hope for a response if this is a bug or feature, though. 

I tried to provide my own interpretation of why it was not supported from the 
get go, we probably won't know now. Does it really matter :-) ?

Do you think it should become a default behaviour ? May be it should, but no 
one has requested it before so may be it was not a blocker for other users.
I've no strong opinion about it, as I said I'd just update the list or provided 
the extension as Xilai recommends. 

May be a feature should have a flag disabled (or enabled by default) that will 
let it iterate to the primary URI too. 
Xilai, would you like to do it, make your extension optionally enabled on the 
trunk ?

Cheers, Sergey



> CXF Failover feature does not return to primary URL. It returns to first in 
> failover urls.
> ------------------------------------------------------------------------------------------
>
>                 Key: CXF-5745
>                 URL: https://issues.apache.org/jira/browse/CXF-5745
>             Project: CXF
>          Issue Type: Bug
>          Components: JAX-WS Runtime
>    Affects Versions: 2.7.5
>            Reporter: Jan Zanda
>            Priority: Minor
>
> I have a WS consumer, which uses one primary URL and up to 8 failover urls. 
> The consumer is created this way (see also comments in code):
> {noformat}
> JaxWsProxyFactoryBean factory = new JaxWsProxyFactoryBean();
> factory.setServiceClass(SomeClientClass.class);
> factory.setAddress(primaryUrl); // this is http://primaryhost/service
> factory.setFeatures(getFailoverFeatures());
> List<AbstractFeature> getFailoverFeatures() {
>   FailoverFeature feature = new FailoverFeature();
>   SequentialStrategy strategy = new SequentialStrategy(); 
>   strategy.setAlternateAddresses(failoverUrls); //failoverUrls is a List of 
> urls.
>   // something like {'http://failoverOne/service', 
> 'http://failoverTwo/service'}
>   feature.setStrategy(strategy);
>   List<AbstractFeature> features = new ArrayList<AbstractFeature>();
>   features.add(feature);
>   return features;
> }
> {noformat}
> However, when application run out of failover URLs, it will write to log this:
> {noformat}
> 2014-05-16 09:00:03,473 WARN  [AbstractStaticFailoverStrategy] no alternate 
> targets remain => giving up on failover
> 2014-05-16 09:00:03,473 INFO  [FailoverTargetSelector] reverted to original 
> address http://failoverOne/service
> {noformat}
> Is there a way how to tell the failover feature to rotate ALL of the urls, 
> primary URL included?
> Thanks. 



--
This message was sent by Atlassian JIRA
(v6.2#6252)

Reply via email to