Class LeastLoadedClientRoutingStrategy

  • All Implemented Interfaces:
    ClientRoutingStrategy

    public class LeastLoadedClientRoutingStrategy
    extends AbstractClientRoutingStrategy
    This strategy is trying to route the request to the least-loaded instances. 1. If the weight of every instance is same, it will fall back to the round-robin fashion. 2. This strategy will skip any blocked instance. 3. When any selected instance is marked as unhealthy, this strategy will try to back-fill with the healthy instances, and there are two purposes: a. The latency shouldn't be affected since this strategy will still try to send request to the required healthy instances. b. The unhealthy instance will still receive any requests, so we could mark it healthy once it is recovered.