-
Notifications
You must be signed in to change notification settings - Fork 2k
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
Additional HttpClientOptions Configurations #22248
Additional HttpClientOptions Configurations #22248
Conversation
sdk/core/azure-core/src/main/java/com/azure/core/util/HttpClientOptions.java
Show resolved
Hide resolved
@@ -26,6 +29,15 @@ public HttpClient createInstance(HttpClientOptions clientOptions) { | |||
.configuration(clientOptions.getConfiguration()) | |||
.writeTimeout(clientOptions.getWriteTimeout()) | |||
.readTimeout(clientOptions.getReadTimeout()); | |||
|
|||
int maximumConnectionPoolSize = (clientOptions.getMaximumConnectionPoolSize() == 0) | |||
? 5 // By default OkHttp uses a maximum idle connection count of 5. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we should not set anything if the user has not configured the pool size. This number could change with later releases of OkHttp.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a required parameter in the constructor, I'll check if they (OkHttp) have it as a constant anywhere.
Fixes #21193
This PR adds additional configuration options to
HttpClientOptions
allowing for easier configuration of anHttpClient
implementation's connection management.