On Tue, 2017-09-26 at 12:18 +0200, Stefan Sobernig wrote: > > > > > with setMaxConnTotal(5) and > > > > > setMaxConnPerRoute(5), assuming that each pool has a min of > > > > > 2? > > > > > Can I > > > > > influence the minimum number of connections? > > > > > > > > > > > > > I am not sure I understand. > > > > > > How can I configure a pool for a given AsyncHttpClient for a size > > > 2-5 > > > (or 3-10 etc.)? > > > > Please use PoolingAsyncClientConnectionManagerBuilder to build an > > instance of PoolingAsyncClientConnectionManager with the desired > > settings or change the settings of an existing > > PoolingAsyncClientConnectionManager through ConnPoolControl > > interface. > > Ok, will try that. On first sight, however, I do not see how to set > the > lower pool size bound (2, 3)? >
There is no such control settings. All persistent are kept alive as long as they are deemed valid. There is no way to keep a connection alive if it is considered non-usable. > https://github.com/apache/httpcomponents- > client/blob/d2b3385ba2b655d9942263964aad78bcca391bda/httpclient5/src/ > main/java/org/apache/hc/client5/http/impl/nio/PoolingAsyncClientConne > ctionManagerBuilder.java > > Another question: I would like to test (enforce) HTTP/1.0 *no* > keep-alive mode in my setup. My plan is to set: > > 1. myRequest.setProtocolVersion(HttpVersion.HTTP_1_0) > 2. drop any Keep-Alive header from the actual responses (using a > response interceptor?) > Both approaches should work (the latter being slightly more preferable). > Or is it more straightforward to define my own > ConnectionKeepAliveStrategy? > The ConnectionReuseStrategy can make the ultimate decision whether or not the connection can be kept alive but at that point it is already too late to inform the opposite endpoint of the intent. It is perfectly legal to drop the connection without sending 'Connection: close' message header but not very nice. Hope this helps Oleg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
