private void configureClient() {
		int maxTotalConnInt = ClientConfig.getInt("maxTotalConnections");
		int maxConnPerHostInt = ClientConfig.getInt("maxConnectionPerHost");
		maxTotalConnections = maxTotalConnInt > 0 ? maxTotalConnInt
				: maxTotalConnections;
		maxConnectionPerHost = maxConnPerHostInt > 0 ? maxConnPerHostInt
				: maxConnectionPerHost;
		if (logger.isDebugEnabled()) {
			logger.debug("maxTotalConnections:"+maxTotalConnections+",maxConnectionPerHost:"+maxConnectionPerHost);
		}

//		SchemeRegistry schemeRegistry = new SchemeRegistry();
//		schemeRegistry.register(new Scheme("http", 80, PlainSocketFactory
//				.getSocketFactory()));
//		schemeRegistry.register(new Scheme("https", 443, SSLSocketFactory
//				.getSocketFactory()));
		connectionManager = new PoolingHttpClientConnectionManager();
		connectionManager.setMaxTotal(maxTotalConnections);
		

//				HttpConnectionManagerParams params = connectionManager.;
		//		params.setConnectionTimeout(connectionTimeOut);
		//		params.setSoTimeout(socketTimeOut);
		
		if (maxTotalConnections > maxConnectionPerHost) {			
			connectionManager.setDefaultMaxPerRoute(maxConnectionPerHost);
		} else {			
			connectionManager.setDefaultMaxPerRoute(maxTotalConnections);
		}
		
		int socketTimeoutConfig = ClientConfig.getInt("soTimeout");
		int connTimeoutConfig = ClientConfig.getInt("connTimeout");
		socketTimeOut = socketTimeoutConfig > 0 ? 
				socketTimeoutConfig : 
					socketTimeOut;
		connectionTimeOut = connTimeoutConfig > 0 ?
				connTimeoutConfig :
					connectionTimeOut;
		
		
		Builder build = SocketConfig.custom()
				.setTcpNoDelay(true)
				.setSoTimeout(socketTimeOut);
		connectionManager.setDefaultSocketConfig(build.build());
		
		
		new IdleConnectionMonitorThread(connectionManager).start();
	}