You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-user@axis.apache.org by Thamayanthi Guhan <th...@gmail.com> on 2014/07/29 20:27:46 UTC
AXIS2 Client
Hi
I am writing axis 2 web service client for persistent connection.
Persistent Connections are not closed when server goes down.
when i use netstat -acpcl connection status as ESTABLISHED all the time.
any help will really save my time, i searched in .net but could not find
any useful
below is my configuration:
configurationContext =
ConfigurationContextFactory.createConfigurationContextFromFileSystem(null ,
null);
MultiThreadedHttpConnectionManager multiThreadedHttpConnectionManager =
new MultiThreadedHttpConnectionManager();
HttpConnectionManagerParams connectionManagerparams = new
HttpConnectionManagerParams();
logger.trace("Default MaxTotalConnection : {}",
connectionManagerparams.getMaxTotalConnections());
logger.trace("Default ConnectionTimeout : {}",
connectionManagerparams.getConnectionTimeout());
connectionManagerparams.setDefaultMaxConnectionsPerHost(supportedOptions.getMaxConnectionPerCacheHttpClient());
connectionManagerparams.setMaxTotalConnections(supportedOptions.getTotalMaxConnection());
connectionManagerparams.setStaleCheckingEnabled(true);
connectionManagerparams.setLinger(supportedOptions.getConnectionIdleTime());
connectionManagerparams.setTcpNoDelay(true);
connectionManagerparams.setSoTimeout(supportedOptions.getSoTimeout());
connectionManagerparams.setConnectionTimeout(supportedOptions.getConnectionTimeout());
multiThreadedHttpConnectionManager.setParams(connectionManagerparams);
if (supportedOptions.isUseConnectionIdleTime()) {
multiThreadedHttpConnectionManager.closeIdleConnections(supportedOptions.getConnectionIdleTime());
}
HttpClient httpClient = new HttpClient(multiThreadedHttpConnectionManager);
configurationContext.setProperty(HTTPConstants.HTTP_PROTOCOL_VERSION,
supportedOptions.getProtocolVersion());
configurationContext.setProperty(HTTPConstants.REUSE_HTTP_CLIENT,
supportedOptions.isReuseHttpClient());
configurationContext.setProperty(HTTPConstants.CACHED_HTTP_CLIENT,
httpClient);
creating stub using configuration context.
using jboss 7 but if i stop server all the connections are closed.
Thanks
Thamayanthi