You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hc.apache.org by ol...@apache.org on 2021/08/27 17:49:30 UTC

[httpcomponents-client] branch master updated: Use setDefaultConnectionConfig instead of deprecated method setValidateAfterInactivity.

This is an automated email from the ASF dual-hosted git repository.

olegk pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/httpcomponents-client.git


The following commit(s) were added to refs/heads/master by this push:
     new 1eeca06  Use setDefaultConnectionConfig instead of deprecated method setValidateAfterInactivity.
1eeca06 is described below

commit 1eeca062f29f4fe6d63f9c4c59528891c40ec9cb
Author: Arturo Bernal <ar...@gmail.com>
AuthorDate: Fri Aug 27 07:06:49 2021 +0200

    Use setDefaultConnectionConfig instead of deprecated method setValidateAfterInactivity.
---
 .../src/main/java/org/apache/hc/client5/http/fluent/Executor.java    | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
index e067d7d..8dbe1b3 100644
--- a/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
+++ b/httpclient5-fluent/src/main/java/org/apache/hc/client5/http/fluent/Executor.java
@@ -35,6 +35,7 @@ import org.apache.hc.client5.http.auth.Credentials;
 import org.apache.hc.client5.http.auth.CredentialsStore;
 import org.apache.hc.client5.http.auth.NTCredentials;
 import org.apache.hc.client5.http.auth.UsernamePasswordCredentials;
+import org.apache.hc.client5.http.config.ConnectionConfig;
 import org.apache.hc.client5.http.cookie.CookieStore;
 import org.apache.hc.client5.http.impl.auth.BasicAuthCache;
 import org.apache.hc.client5.http.impl.auth.BasicCredentialsProvider;
@@ -64,7 +65,9 @@ public class Executor {
                         .useSystemProperties()
                         .setMaxConnPerRoute(100)
                         .setMaxConnTotal(200)
-                        .setValidateAfterInactivity(TimeValue.ofSeconds(10))
+                        .setDefaultConnectionConfig(ConnectionConfig.custom()
+                                .setValidateAfterInactivity(TimeValue.ofSeconds(10))
+                                .build())
                         .build())
                 .useSystemProperties()
                 .evictExpiredConnections()