Skip to content

Add HttpClientFactory Capability to AvaTaxClient #148

Open
ch53k wants to merge 4 commits into
avadev:mainfrom
southportsolutions:httpclientfactory
Open

Add HttpClientFactory Capability to AvaTaxClient #148
ch53k wants to merge 4 commits into
avadev:mainfrom
southportsolutions:httpclientfactory

Conversation

@ch53k

@ch53k ch53k commented Jan 21, 2021

Copy link
Copy Markdown

In .Net Core and higher using the HttpClientFactory is the preferred method for managing HTTP Clients. https://docs.microsoft.com/en-us/aspnet/core/fundamentals/http-requests?view=aspnetcore-5.0#typed-clients

The PR includes 2 new public constructors that added the HttpClient parameter. An additional private parameterless constructor to initialize the static HttpClient, if one of the new HttpClient parameter constructors is not used.

@jusbuc2k

Copy link
Copy Markdown

Any chance we can get the conflicts resolved and this PR merged? I'm concerned about using this in a SaaS deployed environment with thousands of customers because with using "new HttpClient()" for every request in a backend API this could easily exhaust the socket pool in our environment.

I would be happy to do another PR that simply allows the HttpClient to be injected if that would help. We would prefer not to fork the code and maintain it ourselves.

@ch53k

ch53k commented Jul 29, 2021

Copy link
Copy Markdown
Author

@jusbuc2k I resolved the conflicts this morning.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants