Interface TrafficLoadBalancer<A extends ServiceInstance,B>

Type Parameters:
A - the type of service instance
B - the type of service request
All Known Implementing Classes:
LeastRequestTrafficLoadBalancer, MinLoadFactorTrafficLoadBalancer, RandomTrafficLoadBalancer, RoundRobinTrafficLoadBalancer, WeightedRandomTrafficLoadBalancer, WeightedRoundRobinTrafficLoadBalancer

public interface TrafficLoadBalancer<A extends ServiceInstance,B>

A traffic load balancer is used in a Service to load balance the traffic among its list of ServiceInstance.

A traffic load balancer is obtained by a service from the TrafficPolicy specified either when resolving the service in a DiscoveryService or when refreshing a service.

Since:
1.12
Author:
Jeremy Kuhn
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Interface
    Description
    static interface 
    A traffic load balancer factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    next(B serviceRequest)
    Returns the next service instance to use to process the specified service request.
  • Method Details

    • next

      Mono<A> next(B serviceRequest)

      Returns the next service instance to use to process the specified service request.

      Parameters:
      serviceRequest - a service request
      Returns:
      a Mono emitting the next service instance