public class HealthCheckServiceInstanceListSupplier extends DelegatingServiceInstanceListSupplier implements 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.FixedServiceInstanceListSupplierdelegate| 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() |
protected Flux<List<ServiceInstance>> |
healthCheckFlux(List<ServiceInstance> instances) |
protected Mono<Boolean> |
isAlive(ServiceInstance serviceInstance) |
getDelegate, getServiceIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilder, fixed, fixedpublic HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, LoadBalancerProperties.HealthCheck healthCheck, org.springframework.web.reactive.function.client.WebClient webClient)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class DelegatingServiceInstanceListSupplierprotected Flux<List<ServiceInstance>> healthCheckFlux(List<ServiceInstance> instances)
public 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.DisposableBeandestroy in class DelegatingServiceInstanceListSupplierCopyright © 2020 Pivotal Software, Inc.. All rights reserved.