diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-05 10:34:07 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-25 10:48:48 +0100 |
commit | d8a3a7bf6d9685db965833064876d8ed02ed0699 (patch) | |
tree | 40a5491e1187a075d1a9c0b000bb9de2f215560e /http-client | |
parent | f8338e1ea64c58a7986f929a4c3c229b92a8cfde (diff) |
VespaHttpClientBuilder follow builder pattern and add connect and socket timeout to builder.
Diffstat (limited to 'http-client')
-rw-r--r-- | http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java | 2 | ||||
-rw-r--r-- | http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java | 2 |
2 files changed, 0 insertions, 4 deletions
diff --git a/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java index c62be40f1db..aab4bf710c1 100644 --- a/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java +++ b/http-client/src/main/java/ai/vespa/hosted/client/AbstractHttpClient.java @@ -114,7 +114,6 @@ public abstract class AbstractHttpClient implements HttpClient { throw new IllegalStateException("No hosts to perform the request against"); } - @SuppressWarnings("deprecation") private HttpClientContext contextWithTimeout(RequestBuilder builder) { HttpClientContext context = HttpClientContext.create(); RequestConfig config = builder.config; @@ -122,7 +121,6 @@ public abstract class AbstractHttpClient implements HttpClient { Optional<Duration> remaining = builder.deadline.timeLeftOrThrow(); if (remaining.isPresent()) { config = RequestConfig.copy(config) - .setConnectTimeout(min(config.getConnectTimeout(), remaining.get())) .setConnectionRequestTimeout(min(config.getConnectionRequestTimeout(), remaining.get())) .setResponseTimeout(min(config.getResponseTimeout(), remaining.get())) .build(); diff --git a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java index fadffef2a87..2d1e80101cf 100644 --- a/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java +++ b/http-client/src/main/java/ai/vespa/hosted/client/HttpClient.java @@ -36,10 +36,8 @@ import static java.util.Objects.requireNonNull; */ public interface HttpClient extends Closeable { - @SuppressWarnings("deprecation") RequestConfig defaultRequestConfig = RequestConfig.custom() .setConnectionRequestTimeout(Timeout.ofSeconds(5)) - .setConnectTimeout(Timeout.ofSeconds(5)) .setRedirectsEnabled(false) .build(); |