Closed oliverkovac closed 5 years ago
Have you also look on implementing microservices best practices? Like for example a circuit breaker? Also, I would like to see if I can implement dependency injection for the HttpClient, as it will help on the testing part
Nope, I'm quite a beginner in this field, so I've just modified what the old one did to reuse connections, without really adding any layer of abstraction over it, that's too much to ask of my networking and microservices knowledge and I'd just end up botching it anyway. I'll check out the circuit breaker.
I am learning too. 😆
I've found out that there is an more elegant solution to the problem in .NET Core 2.1 which we're using, so I've changed it to use that. HttpClients in the ApiWebClient should now close the connection after a minute so following request would open a new one along with a new DNS lookup, which is just what we need.