cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmera <david.m...@payulatam.com>
Subject MultiThreadedHttpConnectionManager Implementation
Date Mon, 11 Apr 2016 15:43:34 GMT
Hi! I was wondering if there is a way to implement 
MultiThreadedHttpConnectionManager
<https://hc.apache.org/httpclient-3.x/apidocs/org/apache/commons/httpclient/MultiThreadedHttpConnectionManager.html>
  
in order to handle a pool connection and reuse connections, something like
the code below (by using Apache AXIS):

private Stub buildStub(Stub stub, int connectionTimeout, int readTimeout) {

stub._getServiceClient().getOptions().setProperty(HTTPConstants.AUTO_RELEASE_CONNECTION,
true);
stub._getServiceClient().getOptions().setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
true);

 MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager = new 
MultiThreadedHttpConnectionManager();

 HttpConnectionManagerParams params = new HttpConnectionManagerParams();
params.setDefaultMaxConnectionsPerHost(STUB_MAX_HOST_CONNECTIONS);
params.setMaxTotalConnections(STUB_MAX_HOST_CONNECTIONS);
params.setConnectionTimeout(connectionTimeout);
params.setSoTimeout(readTimeout);

 multiThreadedHttpConnectionManager.setParams(params);
HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);


stub._getServiceClient().getOptions().setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
httpClient);

 return stub;

}

Thanks in advance



--
View this message in context: http://cxf.547215.n5.nabble.com/MultiThreadedHttpConnectionManager-Implementation-tp5767796.html
Sent from the cxf-dev mailing list archive at Nabble.com.

Mime
View raw message