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

[WIP] Updates URI Health checks to leverage IHttpClientFactory #33

Merged
merged 2 commits into from
Dec 15, 2018

Conversation

joncloud
Copy link
Contributor

Addresses concerns in #30 by adding the Microsoft.Extensions.Http package to include lifetime management for HttpClient. This also adds functional tests for the health checks.

New Dependencies:

  • Runtime: Microsoft.Extensions.Http
  • Testing: https://httpbin.org

I think that we can do some work to adjust the testing dependency and change it so that we integrate directly with a testing host that mimics the same functionality, or we can host the httpbin dependency ourselves with docker.

@unaizorrilla
Copy link
Collaborator

Looks good, I try to merge it this weekend, thanks!

@unaizorrilla unaizorrilla merged commit d8fcf21 into Xabaril:master Dec 15, 2018
@unaizorrilla
Copy link
Collaborator

Hi @joncloud

Thanks for contributing with this new feature on Uri HealthChecks. I added also some code in UiAndApi sample on how to use Polly policy handlers on this Uri HealthChecks.

          var retryPolicy = HttpPolicyExtensions
                .HandleTransientHttpError()
                .Or<TimeoutRejectedException>()
                .RetryAsync(5);

            services.AddHttpClient("uri-group") //default healthcheck registration name for uri ( you can change it on AddUrlGroup )
                .AddPolicyHandler(retryPolicy);

Next time please increment the package version on dependencies.props, build is performed and when finish this create new version package 2.2.1 for this HealthChecks on Nuget.

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