此文档已经不再维护。您当前查看的是快照版本。如果想要查看最新版本的文档,请参阅最新版本。
对等网络节点组网器。
org.apache.dubbo.remoting.p2p.Networker
<dubbo:protocol networker="xxx" />
<!-- 缺省值设置,当<dubbo:protocol>没有配置networker属性时,使用此配置 -->
<dubbo:provider networker="xxx" />
org.apache.dubbo.remoting.p2p.support.MulticastNetworker
org.apache.dubbo.remoting.p2p.support.FileNetworker
Maven 项目结构:
src
|-main
|-java
|-com
|-xxx
|-XxxNetworker.java (实现Networker接口)
|-resources
|-META-INF
|-dubbo
|-org.apache.dubbo.remoting.p2p.Networker (纯文本文件,内容为:xxx=com.xxx.XxxNetworker)
XxxNetworker.java:
package com.xxx;
import org.apache.dubbo.remoting.p2p.Networker;
public class XxxNetworker implements Networker {
public Group lookup(URL url) {
// ...
}
}
META-INF/dubbo/org.apache.dubbo.remoting.p2p.Networker:
xxx=com.xxx.XxxNetworker