Hi Oleg,

Thanks a lot for all your answers. I'll work on this a bit more.

There is just one problematic thing for us. Our app is an api gateway, and one 
important piece is the response timeouts between our app and the client 
application servers. If fact, it's common the user changes these response 
timeouts from the admin console.

If now they cannot change them on the fly, that means stopping the http pool, 
recreating the ioreactor with the new timeout and starting the pool again, even 
if this takes just several seconds is something I cannot do with installations 
that are processing more than 15.000 requests per second.

The main purpose to move to HttpClient5 is the http pool with Lax Max 
connections (PoolConcurrencyPolicy.LAX), because we were detecting contention 
on the current pool due to the global lock. We don't need HTTP/2  so, from my 
ignorance, is there any way to use a Lax Pool with http1.1 in order to get this 
socket timeout at request level?

Thanks,

Joan.

-----Mensaje original-----
De: Oleg Kalnichevski [mailto:ol...@apache.org] 
Enviado el: viernes, 19 de octubre de 2018 17:21
Para: HttpClient User Discussion
Asunto: Re: Migration from Async 4.1.3 to HttpClient 5

On Fri, 2018-10-19 at 15:08 +0200, Joan Balagueró wrote:
> Hello,
> 
>  
> 
> We are in the process of migrating to HttpClient5 from 
> AsyncClient4.1.3, and we have some quiestions:
> 
>  
> 
> 1.       this.rc =
> RequestConfig.custom().setAuthenticationEnabled(false).
> 
>  
> setConnectionRequestTimeout(Timeout.ofMillis(this.poolTimeout)).
> 
>  
> setConnectionRequestTimeout(this.poolTimeout, TimeUnit.MILLISECONDS).
> 
>  
> setConnectionTimeout(Timeout.ofMillis(this.connectionTimeout)).
> 
>  
> setConnectTimeout(this.connectionTimeout, TimeUnit.MILLISECONDS).
> 

#setConnectTimeout was left out by mistake. It got removed after 5.0-
beta1

https://github.com/apache/httpcomponents-client/commit/60571ae8fa89918518fed57bc5a9785362f9a39a

               
> 
>  
> 
> 2.       The
> PoolingAsyncClientConnectionManagerBuilder.setConnectionTimeToLive()
> is the
> keep alive to set to connections in this pool?
> 
> (similar to what we do in
> HttpAsyncClients.custom().setKeepAliveStrategy()?)
> 

PoolingAsyncClientConnectionManagerBuilder#setConnectionTimeToLive sets the 
_total_ time to live for any connection. No connection will be kept alive past 
its TTL (time to live). Keep-alive time is always incremental.

> 
> 3.       In previous AsyncClient, we set the setSocketTimeout at
> RequestConfig level, so on each request I could copy this base ‘rc’
> and
> modify the response timeout.
> 
> But this method does no longer exist in RequestConfig. Where can I set 
> the response timeout now for each request?
> 

With HTTP/2 a single request can no longer alter the socket timeout for
the connection shared with other message streams. One needs to set the
socket timeout while building HttpAsyncClient instances with
IOReactorConfig

https://github.com/apache/httpcomponents-client/blob/master/httpclient5/src/main/java/org/apache/hc/client5/http/impl/async/HttpAsyncClientBuilder.java#L317

>  
> 
> 4.       I imagine the PoolConcurrencyPolicy cannot be modified after
> creating the pool …
> 

No, it cannot.

>  
> 
> 5.       Before I had this method to set buffer sizes (and modify
> them on
> the fly), getting the ConnectionConfig from the pool:
> 
>  
> 
> public void setBufferInInterface(int bufferInInterface) { 
> 
>  
> this.phccm.setDefaultConnectionConfig(ConnectionConfig.custom().setBu
> fferSiz
> e(bufferInInterface).setFragmentSizeHint(bufferInInterface).build());
>  
> 
> }
> 
>  
> 
> How can I do this now?
> 

Why would you want to modify those settings at runetime?

Oleg


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




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

Reply via email to