Hi,

I've written a LoadDistributingConduitSelector, based on the FailoverTargetSelector.

Would you like me to convert it to a Feature and submit it as part of CXF?


It doesn't subclass FailoverTargetSelector because it needs access to the private InvocationContext stuff, but it could replace the FailoverTargetSelector because distribution across addresses is optional and by default is off. Or, if I'm making it part of CXF I could change the appropriate bits of FailoverTargetSelector to protected.

When distribution is turned on it asks the FailoverStrategy for the list of alternate addresses in selectConduit. It first tries calling getAlternateAddresses( null ) in order to set up a list of alternate addresses that will work across any exchange (and that is thus remembered until it runs out of addresses) - if the FailoverStrategy can't cope with returning alternate addresses for a null Exchange the LoadDistributingConduitSelector will call getAlternateAddresses(exchange) but obviously can't remember the result - which means that if the FailoverStrategy returns the same result from selectAlternateAddress there will be no load distribution. All the FailoverStrategy classes that I can find handle getAlternateAddresses( null ).

It is no more or less thread safe than the FailoverTargetSelector.

I haven't yet tested it with multiple endpoints, just multiple addresses.

Jim

Reply via email to