diff options
author | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-26 16:57:19 +0100 |
---|---|---|
committer | Henning Baldersheim <balder@yahoo-inc.com> | 2023-01-26 16:57:19 +0100 |
commit | f521407e98bfdeea801f6c8e46e2d1edd234bf12 (patch) | |
tree | 7b9c0382a3164942ec5f37d8d64993fd0f6c0c35 /orchestrator | |
parent | 8dce093d125005b1d490e6edd4e87eb0c522a6e6 (diff) |
Avoid deprecated apache http 5.2 methods, by adding it to the builder.
Diffstat (limited to 'orchestrator')
-rw-r--r-- | orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java index 479d6bfe079..e70a05dcb7c 100644 --- a/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java +++ b/orchestrator/src/main/java/com/yahoo/vespa/orchestrator/controller/RetryingClusterControllerClientFactory.java @@ -8,6 +8,7 @@ import com.yahoo.component.annotation.Inject; import com.yahoo.component.AbstractComponent; import com.yahoo.vespa.applicationmodel.HostName; import org.apache.hc.core5.http.message.BasicHeader; +import org.apache.hc.core5.util.Timeout; import java.io.IOException; import java.util.List; @@ -19,16 +20,19 @@ import java.util.logging.Logger; */ public class RetryingClusterControllerClientFactory extends AbstractComponent implements ClusterControllerClientFactory { - private static Logger log = Logger.getLogger(RetryingClusterControllerClientFactory.class.getName()); + private static final Logger log = Logger.getLogger(RetryingClusterControllerClientFactory.class.getName()); private final HttpClient client; @Inject public RetryingClusterControllerClientFactory() { - this(AbstractHttpClient.wrapping(VespaHttpClientBuilder.create() - .setUserAgent("orchestrator-cluster-controller-client") - .setDefaultHeaders(List.of(new BasicHeader("Accept", "application/json"))) - .build())); + this(AbstractHttpClient.wrapping(VespaHttpClientBuilder + .custom() + .connectTimeout(Timeout.ofSeconds(5)) + .apacheBuilder() + .setUserAgent("orchestrator-cluster-controller-client") + .setDefaultHeaders(List.of(new BasicHeader("Accept", "application/json"))) + .build())); } RetryingClusterControllerClientFactory(HttpClient client) { |