Class ZoneAwareClusterInvoker<T>
java.lang.Object
org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker<T>
org.apache.dubbo.rpc.cluster.support.registry.ZoneAwareClusterInvoker<T>
- All Implemented Interfaces:
org.apache.dubbo.common.Node,ClusterInvoker<T>,Invoker<T>
When there are more than one registry for subscription.
This extension provides a strategy to decide how to distribute traffics among them: 1. registry marked as 'preferred=true' has the highest priority. 2. check the zone the current request belongs, pick the registry that has the same zone first. 3. Evenly balance traffic between all registries based on each registry's weight.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiondoInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) Methods inherited from class org.apache.dubbo.rpc.cluster.support.AbstractClusterInvoker
destroy, getDirectory, getInterface, getRegistryUrl, getUrl, invoke, isAvailable, isDestroyed, toStringMethods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface org.apache.dubbo.rpc.cluster.ClusterInvoker
hasProxyInvokers, isServiceDiscovery
-
Constructor Details
-
ZoneAwareClusterInvoker
-
-
Method Details
-
doInvoke
public Result doInvoke(Invocation invocation, List<Invoker<T>> invokers, LoadBalance loadbalance) throws RpcException - Throws:
RpcException
-