Neeme Praks created CXF-8109:
--------------------------------

             Summary: Instructions for configuring client programmatically do 
not survive failover
                 Key: CXF-8109
                 URL: https://issues.apache.org/jira/browse/CXF-8109
             Project: CXF
          Issue Type: Bug
          Components: Documentation
    Affects Versions: 3.3.3
            Reporter: Neeme Praks


[http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Usingjavacode]
 suggests to configure HttpConduit like this:

 
{code:java}
Client client = ClientProxy.getClient(greeter);
HTTPConduit http = (HTTPConduit) client.getConduit();
 
HTTPClientPolicy httpClientPolicy = new HTTPClientPolicy();
 
httpClientPolicy.setConnectionTimeout(36000);
httpClientPolicy.setAllowChunking(false);
httpClientPolicy.setReceiveTimeout(32000);
 
http.setClient(httpClientPolicy);
{code}
While this works initially, it fails as soon as a failover happens. During 
failover, existing {{HttpConduit}} is disposed and new one is created. The 
policy and other settings are not copied from old conduit to new one (we found 
out the hard way, in production).

 

Instead, one should use get hold of {{Bus}} instance (we get it from Spring) 
and make use of {{HTTPConduitConfigurer}} extension point:

 
{code:java}
bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
{code}
We use {{JaxWsProxyFactoryBean}} for this (it has {{setBus()}} method), I'm not 
sure how to modify the sample in the documentation.

 
{{}}



--
This message was sent by Atlassian Jira
(v8.3.2#803003)

Reply via email to