Class RandomLoadBalance

java.lang.Object
org.apache.dubbo.rpc.cluster.loadbalance.AbstractLoadBalance
org.apache.dubbo.rpc.cluster.loadbalance.RandomLoadBalance
All Implemented Interfaces:
LoadBalance

public class RandomLoadBalance extends AbstractLoadBalance
This class select one provider from multiple providers randomly. You can define weights for each provider: If the weights are all the same then it will use random.nextInt(number of invokers). If the weights are different then it will use random.nextInt(w1 + w2 + ... + wn) Note that if the performance of the machine is better than others, you can set a larger weight. If the performance is not so good, you can set a smaller weight.
  • Field Details

  • Constructor Details

    • RandomLoadBalance

      public RandomLoadBalance()