Details
-
Bug
-
Status: Closed
-
Minor
-
Resolution: Information Provided
-
3.3.3
-
None
-
None
-
Unknown
Description
http://cxf.apache.org/docs/client-http-transport-including-ssl-support.html#ClientHTTPTransport(includingSSLsupport)-Usingjavacode suggests to configure HttpConduit like this:
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);
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 get hold of Bus instance (we get it from Spring) and make use of HTTPConduitConfigurer extension point:
bus.setExtension(httpConduitConfigurer, HTTPConduitConfigurer.class);
We use JaxWsProxyFactoryBean for this (it has setBus() method), I'm not sure how to modify the sample in the documentation.