hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Escobar <eb.j...@gmail.com>
Subject Re: Deprecated methods
Date Thu, 14 Jun 2012 12:01:06 GMT
PoolingClientConnectionManager connectionManager=new
PoolingClientConnectionManager(schemeRegistry, 15,
java.util.concurrent.TimeUnit.SECONDS);
		
		// Increase max total connection to 100
		connectionManager.setMaxTotal(100);
		// Increase default max connection per route to 15
		connectionManager.setDefaultMaxPerRoute(15);
		// Increase max connections for localhost:80 to 80
		HttpHost localhost = new HttpHost("locahost", 80);
		connectionManager.setMaxPerRoute(new HttpRoute(localhost), 50);

2012/6/14 Joan Balaguero <joan.balaguero@grupoventus.com>:
> Hello,
>
>
>
> I’ve been moving from 4.0.3 to 4.2.
>
>
>
> The following methods are deprecated:
>
>
>
>  ClientConnectionManager cm = new
> ThreadSafeClientConnManager(this.objHttpParams,
> HttpUtils.createDefaultSchemeRegistry());
>
>
>
>  ConnManagerParams.setTimeout(this.objHttpParams, 1);
>
>
>
>
> ConnManagerParams.setMaxTotalConnections(this.objHttpParams,Integer.MAX_VALU
> E);
>
>
>
>  ConnManagerParams.setMaxConnectionsPerRoute(this.objHttpParams, new
> ConnPerRouteBean(Integer.MAX_VALUE));
>
>
>
>
>
>
>
> I see that now I have to use:
>
>
>
>   ClientConnectionManager cm = new
> PoolingClientConnectionManager(HttpUtils.createDefaultSchemeRegistry());
>
>   this.objHttp               = new DefaultHttpClient(cm,
> this.objHttpParams);
>
>
>
>
>
> But how can I set the pool timeout, maxtotal and maxtotalperorute?
>
>
>
> Thanks,
>
> Joan.
>
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: httpclient-users-unsubscribe@hc.apache.org
For additional commands, e-mail: httpclient-users-help@hc.apache.org


Mime
View raw message