Class ReactiveCompositeDiscoveryClient
java.lang.Object
org.springframework.cloud.client.discovery.composite.reactive.ReactiveCompositeDiscoveryClient
- All Implemented Interfaces:
ReactiveDiscoveryClient,org.springframework.core.Ordered
A
ReactiveDiscoveryClient that is composed of other discovery clients and
delegates calls to each of them. By default, instance lookup uses the fastest non-empty
response. Client ordering can instead be enforced by using the constructor accepting
orderEnforced. Instance results can be combined from all discovery clients by
enabling combineInstances.- Author:
- Tim Ysewyn
-
Field Summary
Fields inherited from interface org.springframework.core.Ordered
HIGHEST_PRECEDENCE, LOWEST_PRECEDENCEFields inherited from interface org.springframework.cloud.client.discovery.ReactiveDiscoveryClient
DEFAULT_ORDER, LOG -
Constructor Summary
ConstructorsConstructorDescriptionReactiveCompositeDiscoveryClient(List<ReactiveDiscoveryClient> discoveryClients) ReactiveCompositeDiscoveryClient(List<ReactiveDiscoveryClient> discoveryClients, boolean orderEnforced) ReactiveCompositeDiscoveryClient(List<ReactiveDiscoveryClient> discoveryClients, boolean orderEnforced, boolean combineInstances) Create a composite discovery client. -
Method Summary
Modifier and TypeMethodDescriptionA human-readable description of the implementation, used in HealthIndicator.reactor.core.publisher.Flux<ServiceInstance>getInstances(String serviceId) Gets all ServiceInstances associated with a particular serviceId.reactor.core.publisher.Flux<String>Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.cloud.client.discovery.ReactiveDiscoveryClient
getOrder, probe, reactiveProbe
-
Constructor Details
-
ReactiveCompositeDiscoveryClient
-
ReactiveCompositeDiscoveryClient
public ReactiveCompositeDiscoveryClient(List<ReactiveDiscoveryClient> discoveryClients, boolean orderEnforced) -
ReactiveCompositeDiscoveryClient
public ReactiveCompositeDiscoveryClient(List<ReactiveDiscoveryClient> discoveryClients, boolean orderEnforced, boolean combineInstances) Create a composite discovery client.- Parameters:
discoveryClients- the discovery clients to delegate toorderEnforced- whether to wait for each client in order before falling back to the next client if it returns no instancescombineInstances- whether to combine instances returned by all discovery clients
-
-
Method Details
-
description
Description copied from interface:ReactiveDiscoveryClientA human-readable description of the implementation, used in HealthIndicator.- Specified by:
descriptionin interfaceReactiveDiscoveryClient- Returns:
- The description.
-
getInstances
Description copied from interface:ReactiveDiscoveryClientGets all ServiceInstances associated with a particular serviceId.- Specified by:
getInstancesin interfaceReactiveDiscoveryClient- Parameters:
serviceId- The serviceId to query.- Returns:
- A List of ServiceInstance.
-
getServices
- Specified by:
getServicesin interfaceReactiveDiscoveryClient- Returns:
- All known service IDs.
-
getDiscoveryClients
-