hc-httpclient-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Oleg Kalnichevski <ol...@apache.org>
Subject Re: Async beta4 Connection Pooling
Date Tue, 18 Jun 2013 14:35:19 GMT
On Tue, 2013-06-18 at 14:13 +0000, Matt Brown wrote:
> Taking a look at async client 4.0-beta4 and looking for a little guidance.
> 
> 
> With beta3 we had some code like:
> 
> PoolingClientAsyncConnectionManager asyncMgr = new PoolingClientAsyncConnectionManager(new
DefaultConnectingIOReactor());
>                 asyncMgr.setMaxTotal(maxConnections);
>                 asyncMgr.setDefaultMaxPerRoute(maxConnections);
>                 asyncMgr.setMaxPerRoute(hapiServer, maxConnections);
> 
> httpAsyncClient = new DefaultHttpAsyncClient(asyncMgr);
> 
> 
> With beta4 I was trying something like:
> 
>                 PoolingNHttpClientConnectionManager asyncMgr = new PoolingNHttpClientConnectionManager(new
DefaultConnectingIOReactor());
> asyncMgr.setMaxTotal(maxConnections);
>                 asyncMgr.setDefaultMaxPerRoute(maxConnections);
>                 asyncMgr.setMaxPerRoute(hapiServer, maxConnections);
> 
>                 httpAsyncClient = HttpAsyncClients.createMinimal(asyncMgr);
> 
> 
> I'm running into "Request cannot be executed; I/O reactor status: INACTIVE".
> 
> So clearly I'm not doing the new pooling connection manager correctly.   Is there documentation/examples
I'm missing?
> 
> Matt

Matt,

I think you simply need to start the client

---
CloseableHttpAsyncClient httpclient = HttpAsyncClients.createMinimal();
httpclient.start();
---

There are some examples that should help you get started

http://hc.apache.org/httpcomponents-asyncclient-dev/examples.html

Oleg



---------------------------------------------------------------------
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