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: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to