public class HealthCheckServiceInstanceListSupplier extends Object implements ServiceInstanceListSupplier, org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean
ServiceInstanceListSupplier implementation that verifies whether the
instances are alive and only returns the healthy one, unless there are none. Uses
WebClient to ping the health endpoint of the instances.ServiceInstanceListSupplier.FixedServiceInstanceListSupplier| Constructor and Description |
|---|
HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate,
LoadBalancerProperties.HealthCheck healthCheck,
org.springframework.web.reactive.function.client.WebClient webClient) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
Flux<List<ServiceInstance>> |
get() |
String |
getServiceId() |
protected Flux<List<ServiceInstance>> |
healthCheckFlux(List<ServiceInstance> instances) |
protected Mono<Boolean> |
isAlive(ServiceInstance serviceInstance) |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitfixedpublic HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, LoadBalancerProperties.HealthCheck healthCheck, org.springframework.web.reactive.function.client.WebClient webClient)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanprotected Flux<List<ServiceInstance>> healthCheckFlux(List<ServiceInstance> instances)
public String getServiceId()
getServiceId in interface ServiceInstanceListSupplierpublic Flux<List<ServiceInstance>> get()
get in interface Supplier<Flux<List<ServiceInstance>>>protected Mono<Boolean> isAlive(ServiceInstance serviceInstance)
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeanCopyright © 2020 Pivotal Software, Inc.. All rights reserved.