Skip to content

Commit

Permalink
[java11] Add default timeout value as Request.Options uses (#1532)
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalijr2 committed Oct 31, 2021
1 parent e8fa87c commit 3a351fa
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions java11/src/main/java/feign/http2client/Http2Client.java
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}

Expand Down

0 comments on commit 3a351fa

Please sign in to comment.