use of org.apache.hc.client5.http.config.Configurable in project feign by OpenFeign.
the class ApacheHttp5Client method configureTimeouts.
protected HttpClientContext configureTimeouts(Request.Options options) {
final HttpClientContext context = new HttpClientContext();
// per request timeouts
final RequestConfig requestConfig = (client instanceof Configurable ? RequestConfig.copy(((Configurable) client).getConfig()) : RequestConfig.custom()).setConnectTimeout(options.connectTimeout(), options.connectTimeoutUnit()).setResponseTimeout(options.readTimeout(), options.readTimeoutUnit()).build();
context.setRequestConfig(requestConfig);
return context;
}
use of org.apache.hc.client5.http.config.Configurable in project feign by OpenFeign.
the class AsyncApacheHttp5Client method configureTimeouts.
protected HttpClientContext configureTimeouts(Request.Options options, HttpClientContext context) {
// per request timeouts
final RequestConfig requestConfig = (client instanceof Configurable ? RequestConfig.copy(((Configurable) client).getConfig()) : RequestConfig.custom()).setConnectTimeout(options.connectTimeout(), options.connectTimeoutUnit()).setResponseTimeout(options.readTimeout(), options.readTimeoutUnit()).build();
context.setRequestConfig(requestConfig);
return context;
}
Aggregations