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 a
user-provided function to ping the health endpoint of the instances.delegate| Constructor and Description |
|---|
HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate,
LoadBalancerProperties.HealthCheck healthCheck,
BiFunction<ServiceInstance,String,reactor.core.publisher.Mono<Boolean>> aliveFunction)
|
HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate,
ReactiveLoadBalancer.Factory<ServiceInstance> loadBalancerClientFactory,
BiFunction<ServiceInstance,String,reactor.core.publisher.Mono<Boolean>> aliveFunction) |
| Modifier and Type | Method and Description |
|---|---|
void |
afterPropertiesSet() |
void |
destroy() |
reactor.core.publisher.Flux<List<ServiceInstance>> |
get() |
protected reactor.core.publisher.Flux<List<ServiceInstance>> |
healthCheckFlux(List<ServiceInstance> instances) |
protected reactor.core.publisher.Mono<Boolean> |
isAlive(ServiceInstance serviceInstance) |
getDelegate, getServiceIdclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitbuilder, get@Deprecated public HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, LoadBalancerProperties.HealthCheck healthCheck, BiFunction<ServiceInstance,String,reactor.core.publisher.Mono<Boolean>> aliveFunction)
public HealthCheckServiceInstanceListSupplier(ServiceInstanceListSupplier delegate, ReactiveLoadBalancer.Factory<ServiceInstance> loadBalancerClientFactory, BiFunction<ServiceInstance,String,reactor.core.publisher.Mono<Boolean>> aliveFunction)
public void afterPropertiesSet()
afterPropertiesSet in interface org.springframework.beans.factory.InitializingBeanafterPropertiesSet in class DelegatingServiceInstanceListSupplierprotected reactor.core.publisher.Flux<List<ServiceInstance>> healthCheckFlux(List<ServiceInstance> instances)
public reactor.core.publisher.Flux<List<ServiceInstance>> get()
get in interface Supplier<reactor.core.publisher.Flux<List<ServiceInstance>>>protected reactor.core.publisher.Mono<Boolean> isAlive(ServiceInstance serviceInstance)
public void destroy()
destroy in interface org.springframework.beans.factory.DisposableBeandestroy in class DelegatingServiceInstanceListSupplierCopyright © 2021 Pivotal Software, Inc.. All rights reserved.