public class RandomLoadBalancer extends Object implements ReactorServiceInstanceLoadBalancer
ReactorServiceInstanceLoadBalancer
.ReactiveLoadBalancer.Factory<T>
REQUEST
Constructor and Description |
---|
RandomLoadBalancer(org.springframework.beans.factory.ObjectProvider<ServiceInstanceListSupplier> serviceInstanceListSupplierProvider,
String serviceId) |
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 RandomLoadBalancer(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 reactor.core.publisher.Mono<Response<ServiceInstance>> choose(Request request)
ReactorLoadBalancer
choose
in interface ReactiveLoadBalancer<ServiceInstance>
choose
in interface ReactorLoadBalancer<ServiceInstance>
request
- - an input requestCopyright © 2023 Pivotal Software, Inc.. All rights reserved.