Browse Source

[java11] Add default timeout value as Request.Options uses (#1532)

pull/1534/head
Witalij Berdinskich 3 years ago committed by GitHub
parent
commit
3a351fa071
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 11
      java11/src/main/java/feign/http2client/Http2Client.java

11
java11/src/main/java/feign/http2client/Http2Client.java

@ -52,10 +52,21 @@ public class Http2Client implements Client, AsyncClient<Object> { @@ -52,10 +52,21 @@ public class Http2Client implements Client, AsyncClient<Object> {
private final HttpClient client;
/**
* Creates the new Http2Client using following defaults:
* <ul>
* <li>Connect Timeout: 10 seconds, as {@link Request.Options#Options()} uses</li>
* <li>Follow all 3xx redirects</li>
* <li>HTTP 2</li>
* </ul>
*
* @see Request.Options#Options()
*/
public Http2Client() {
this(HttpClient.newBuilder()
.followRedirects(Redirect.ALWAYS)
.version(Version.HTTP_2)
.connectTimeout(Duration.ofMillis(10000))
.build());
}

Loading…
Cancel
Save