Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Oct 31, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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