You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@cxf.apache.org by Jim Talbut <jt...@spudsoft.co.uk> on 2010/08/02 17:53:28 UTC

Converting failover into load distribution

Hi all,

Is it possible to have a jaxws:client use the failover strategy  
immediately, without providing an address on the client itself?
I have this:
   <jaxws:client id="testServiceClient"
                  
serviceClass="com.groupgti.wsdl.testservices.TestServicesPortType"
                 >
     <jaxws:features>
       <clustering:failover>
         <clustering:strategy>
           <bean class="spudsoft.cxfutilities.RoundRobinDnsFailoverStrategy" >
             <property name="baseUrl"  
value="http://round-robin:8080/TestServices-1.0-SNAPSHOT/TestServices"  
/>
           </bean>
         </clustering:strategy>
       </clustering:failover>
     </jaxws:features>
   </jaxws:client>

And it works, but it generates an ugly message when it fails because  
there is no address specified.

The RoundRobinDnsFailoverStrategy parses the URL (using java.net.URL),  
extracts the host part, performs a DNS lookup on that and then uses  
that to initialize its list of endpoints (which it gives out at random).
I don't think there is any way to do the handling of URLs from round  
robin DNS lookups in CXF, would you like me to make it available?  
(it's very simple).

Jim

----------------------------------------------------------------
This message was sent using IMP, the Internet Messaging Program.