Add function-based health check. Add restTemplate-based health-check beans to default config (#866)

* Switch to a function-based HealthCheckServiceInstanceListSupplier.

* Handle exception for restTemplate based function. Add default blocking health-check configuration.

* Add docs.
This commit is contained in:
Olga Maciaszek-Sharma
2020-12-11 10:20:57 -06:00
committed by GitHub
parent c6bd75eb5d
commit ddd370c57d
8 changed files with 232 additions and 36 deletions

View File

@@ -968,6 +968,9 @@ public class CustomLoadBalancerConfiguration {
}
----
TIP: For the non-reactive stack, create this supplier with the `withBlockingHealthChecks()`.
You can also pass your own `WebClient` or `RestTemplate` instance to be used for the checks.
WARNING: `HealthCheckServiceInstanceListSupplier` has its own caching mechanism based on Reactor Flux `replay()`. Therefore, if it's being used, you may want to skip wrapping that supplier with `CachingServiceInstanceListSupplier`.
=== Same instance preference for LoadBalancer