Hi Lesley, I'll send you a working example with instructions in a separate mail.
Cheers, Eoghan On 24 February 2010 03:54, LTay <[email protected]> wrote: > > Ok I've just upgraded my jars to 2.2.6 and still getting the assertion > failure. > > Does anyone have a working example of a client that implements failover > that > I could maybe take a look at to ensure I'm doing the right thing? > > I tried following this example that I've seen for FUSE > > http://www.iona.com/support/docs/artix/5.0/deploy/java/wwhelp/wwhimpl/js/html/wwhelp.htm > to setup static failover, so I think I've set things up correctly already. > > > > LTay wrote: > > > > Sorry I forgot to mention I'm currently using cxf 2.1.3 but as I > > understand it failover should already be available in that version. > Please > > let me know if it's not.. I guess if I don't get anywhere I'll have to > try > > and upgrade to the latest version to see if that fixes my issue. > > > > > > Eoghan Glynn-4 wrote: > >> > >> Lesley, > >> > >> Try it without the id attribute being set on your <jaxws:client> beans, > >> i.e. > >> > >> <jaxws:client name="{ > >> http://www.test.com/Authentication}AuthenticationPrimaryPortType<http://www.test.com/Authentication%7DAuthenticationPrimaryPortType> > <http://www.test.com/Authentication%7DAuthenticationPrimaryPortType> > >> " > >> createdFromAPI="true"> > >> <jaxws:features> > >> <clustering:failover> > >> <clustering:strategy> > >> <ref bean="Random"/> > >> </clustering:strategy> > >> </clustering:failover> > >> </jaxws:features> > >> </jaxws:client> > >> > >> <jaxws:client name="{ > >> http://www.test.com/Authentication}AuthenticationSecondaryPortType<http://www.test.com/Authentication%7DAuthenticationSecondaryPortType> > <http://www.test.com/Authentication%7DAuthenticationSecondaryPortType> > >> " > >> createdFromAPI="true"> > >> <jaxws:features> > >> <clustering:failover> > >> <clustering:strategy> > >> <ref bean="Random"/> > >> </clustering:strategy> > >> </clustering:failover> > >> </jaxws:features> > >> </jaxws:client> > >> > >> <jaxws:client name="{ > >> http://www.test.com/Authentication}AuthenticationTertiaryPortType<http://www.test.com/Authentication%7DAuthenticationTertiaryPortType> > <http://www.test.com/Authentication%7DAuthenticationTertiaryPortType> > >> " > >> createdFromAPI="true"> > >> <jaxws:features> > >> <clustering:failover> > >> <clustering:strategy> > >> <ref bean="Random"/> > >> </clustering:strategy> > >> </clustering:failover> > >> </jaxws:features> > >> </jaxws:client> > >> </beans> > >> > >> > >> Cheers, > >> Eoghan > >> > >> > >> On 23 February 2010 13:46, LTay <[email protected]> wrote: > >> > >>> > >>> Hi there, > >>> > >>> Hoping someone can shed some light on this. I'm trying to use the > >>> failover > >>> feature on CXF but have not been able to get it working. > >>> > >>> I've set up a cxf-client.xml which contains the failover setup: > >>> > >>> <?xml version="1.0" encoding="UTF-8"?> > >>> <beans xmlns="http://www.springframework.org/schema/beans" > >>> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > >>> xmlns:cxf="http://cxf.apache.org/core" > >>> xmlns:jaxws="http://cxf.apache.org/jaxws" > >>> xmlns:clustering="http://cxf.apache.org/clustering" > >>> xsi:schemaLocation="http://cxf.apache.org/core > >>> http://cxf.apache.org/schemas/core.xsd > >>> http://cxf.apache.org/jaxws > >>> http://cxf.apache.org/schemas/jaxws.xsd > >>> http://www.springframework.org/schema/beans > >>> http://www.springframework.org/schema/beans/spring-beans.xsd > "> > >>> > >>> <import resource="classpath:META-INF/cxf/cxf.xml" /> > >>> <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" > >>> /> > >>> <import resource="classpath:META-INF/cxf/cxf-servlet.xml" /> > >>> > >>> <bean id="Random" class="org.apache.cxf.clustering.RandomStrategy"/> > >>> > >>> <jaxws:client id="AuthenticationPrimaryPortType" > >>> name="{ > http://www.test.com/Authentication}AuthenticationPrimaryPortType<http://www.test.com/Authentication%7DAuthenticationPrimaryPortType> > <http://www.test.com/Authentication%7DAuthenticationPrimaryPortType> > >>> " > >>> createdFromAPI="true"> > >>> <jaxws:features> > >>> <clustering:failover> > >>> <clustering:strategy> > >>> <ref bean="Random"/> > >>> </clustering:strategy> > >>> </clustering:failover> > >>> </jaxws:features> > >>> </jaxws:client> > >>> > >>> <jaxws:client id="AuthenticationSecondaryPortType" > >>> name="{ > http://www.test.com/Authentication}AuthenticationSecondaryPortType<http://www.test.com/Authentication%7DAuthenticationSecondaryPortType> > <http://www.test.com/Authentication%7DAuthenticationSecondaryPortType> > >>> " > >>> createdFromAPI="true"> > >>> <jaxws:features> > >>> <clustering:failover> > >>> <clustering:strategy> > >>> <ref bean="Random"/> > >>> </clustering:strategy> > >>> </clustering:failover> > >>> </jaxws:features> > >>> </jaxws:client> > >>> > >>> <jaxws:client id="AuthenticationTertiaryPortType" > >>> name="{ > http://www.test.com/Authentication}AuthenticationTertiaryPortType<http://www.test.com/Authentication%7DAuthenticationTertiaryPortType> > <http://www.test.com/Authentication%7DAuthenticationTertiaryPortType> > >>> " > >>> createdFromAPI="true"> > >>> <jaxws:features> > >>> <clustering:failover> > >>> <clustering:strategy> > >>> <ref bean="Random"/> > >>> </clustering:strategy> > >>> </clustering:failover> > >>> </jaxws:features> > >>> </jaxws:client> > >>> </beans> > >>> > >>> > >>> I've got the clustered service set up in the wsdl as well: > >>> > >>> <service name="AuthenticationClusteredWebService"> > >>> <port name="AuthenticationPrimaryPortType" > >>> binding="AUTH-SCENARIO:AuthenticationWebService"> > >>> <SOAP:address location="https://server1"/> > >>> </port> > >>> <port name="AuthenticationSecondaryPortType" > >>> binding="AUTH-SCENARIO:AuthenticationWebService"> > >>> <SOAP:address location="https://server2"/> > >>> </port> > >>> <port name="AuthenticationTertiaryPortType" > >>> binding="AUTH-SCENARIO:AuthenticationWebService"> > >>> <SOAP:address location="https://server3"/> > >>> </port> > >>> </service> > >>> > >>> But when I test the failover by taking down the service at server1, I > >>> get a > >>> SocketConnectionException complaining of a connection timeout. It > >>> doesn't > >>> try to use the other port types. > >>> > >>> I also noticed that by running this to assert that the failover feature > >>> does > >>> get set up, the assertion below returns false. Instead the > >>> conduitSelector > >>> is of type UpfrontConduitSelector: > >>> > >>> AuthenticationPortType proxy = new > >>> > >>> > AuthenticationClusteredWebService(getWSDL()).getAuthenticationPrimaryPortType() > >>> > >>> ConduitSelector conduitSelector = > >>> ClientProxy.getClient(proxy).getConduitSelector(); > >>> assertTrue(FailoverTargetSelector.class.isInstance(conduitSelector)); > >>> > >>> So for some reason the failover feature in my cxf-client.xml gets > >>> ignored. > >>> > >>> > >>> If anyone's got any ideas that would be great. I've tried to follow the > >>> system testing class I found at: > >>> > >>> > http://svn.apache.org/viewvc/cxf/trunk/systests/uncategorized/src/test/java/org/apache/cxf/systest/clustering/FailoverTest.java > >>> and how the failover.xml is setup. Maybe I'm just missing something > >>> else.. > >>> > >>> > >>> Thanks, > >>> Lesley > >>> > >>> -- > >>> View this message in context: > >>> > http://old.nabble.com/Failover-config-for-cxf-seems-to-get-ignored-tp27703526p27703526.html > >>> Sent from the cxf-user mailing list archive at Nabble.com. > >>> > >>> > >> > >> > > > > > > -- > View this message in context: > http://old.nabble.com/Failover-config-for-cxf-seems-to-get-ignored-tp27703526p27714085.html > Sent from the cxf-user mailing list archive at Nabble.com. > >
