public class RoundRobinLoadBalancer extends Object implements ReactorServiceInstanceLoadBalancer
ReactorServiceInstanceLoadBalancer
.ReactiveLoadBalancer.Factory<T>
REQUEST
Constructor and Description |
---|
RoundRobinLoadBalancer(org.springframework.beans.factory.ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider,
String serviceId) |
RoundRobinLoadBalancer(org.springframework.beans.factory.ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider,
String serviceId,
int seedPosition) |
Modifier and Type | Method and Description |
---|---|
reactor.core.publisher.Mono<Response<ServiceInstance>> |
choose(Request request)
Choose the next server based on the load balancing algorithm.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
choose
public RoundRobinLoadBalancer(org.springframework.beans.factory.ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider, String serviceId)
serviceInstanceListSupplierProvider
- a provider of
ServiceInstanceListSupplier
that will be used to get available instancesserviceId
- id of the service for which to choose an instancepublic RoundRobinLoadBalancer(org.springframework.beans.factory.ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider, String serviceId, int seedPosition)
serviceInstanceListSupplierProvider
- a provider of
ServiceInstanceListSupplier
that will be used to get available instancesserviceId
- id of the service for which to choose an instanceseedPosition
- Round Robin element position markerpublic reactor.core.publisher.Mono<Response<ServiceInstance>> choose(Request request)
ReactorLoadBalancer
choose
in interface ReactiveLoadBalancer<ServiceInstance>
choose
in interface ReactorLoadBalancer<ServiceInstance>
request
- - an input requestCopyright © 2021 Pivotal Software, Inc.. All rights reserved.