Select one from multiple service providers to call.
org.apache.dubbo.rpc.cluster.RouterFactoryorg.apache.dubbo.rpc.cluster.Routerorg.apache.dubbo.rpc.cluster.router.ScriptRouterFactoryorg.apache.dubbo.rpc.cluster.router.FileRouterFactoryorg.apache.dubbo.rpc.cluster.router.condition.config.AppRouterFactoryorg.apache.dubbo.rpc.cluster.CacheableRouterFactoryorg.apache.dubbo.rpc.cluster.router.condition.ConditionRouterFactoryorg.apache.dubbo.rpc.cluster.router.mock.MockRouterFactoryorg.apache.dubbo.rpc.cluster.router.condition.config.ServiceRouterFactoryorg.apache.dubbo.rpc.cluster.router.tag.TagRouterFactoryMaven project structure:
src
|-main
|-java
|-com
|-xxx
|-XxxRouterFactory.java (implements RouterFactory interface)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.rpc.cluster.RouterFactory (plain text file, content: xxx=com.xxx.XxxRouterFactory)
XxxRouterFactory.java:
package com.xxx;
import org.apache.dubbo.rpc.cluster.RouterFactory;
import org.apache.dubbo.rpc.Invoker;
import org.apache.dubbo.rpc.Invocation;
import org.apache.dubbo.rpc.RpcException;
public class XxxRouterFactory implements RouterFactory {
public Router getRouter(URL url) {
// ...
}
}
META-INF/dubbo/org.apache.dubbo.rpc.cluster.RouterFactory:
xxx=com.xxx.XxxRouterFactory