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

Additional HttpClientOptions Configurations #22248

Conversation

alzimmermsft
Copy link
Member

Fixes #21193

This PR adds additional configuration options to HttpClientOptions allowing for easier configuration of an HttpClient implementation's connection management.

@alzimmermsft alzimmermsft added Client This issue points to a problem in the data-plane of the library. Azure.Core azure-core labels Jun 11, 2021
@alzimmermsft alzimmermsft self-assigned this Jun 11, 2021
@@ -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.
Copy link
Member

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.

Copy link
Member Author

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.

@alzimmermsft alzimmermsft merged commit f3fac45 into Azure:master Jun 15, 2021
@alzimmermsft alzimmermsft deleted the AzCore_AdditionalHttpClientOptionConfigurations branch June 15, 2021 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Azure.Core azure-core Client This issue points to a problem in the data-plane of the library.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Support Additional Configurations in HttpClientOptions
2 participants