Cluster Expansion

Expansion Description

When there are multiple service providers, organize multiple service providers into a cluster and pretend to be one provider.

Extension ports


Extended configuration

<dubbo:protocol cluster="xxx" />
<!-- Default value configuration, if <dubbo:protocol> is not configured with cluster, use this configuration -->
<dubbo:provider cluster="xxx" />

Known extensions


Extended example

Maven project structure:

                | (implements the Cluster interface)
                |-org.apache.dubbo.rpc.cluster.Cluster (plain text file, content:

import org.apache.dubbo.rpc.cluster.Cluster;
import org.apache.dubbo.rpc.cluster.Directory;
import org.apache.dubbo.rpc.cluster.LoadBalance;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.Result;
import org.apache.dubbo.rpc.RpcException;
public class XxxCluster implements Cluster {
    public <T> Invoker<T> merge(Directory<T> directory) throws RpcException {
        return new AbstractClusterInvoker<T>(directory) {
            public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException {


Last modified January 2, 2023: Enhance en docs (#1798) (95a9f4f6c1c)