Networking Extension

Networking Extension

Extension Description

Peer network node networker.

Extension Interface

org.apache.dubbo.remoting.p2p.Networker

Extension Configuration

<dubbo:protocol networker="xxx" />
<!-- Default setting. When <dubbo:protocol> does not configure the networker attribute, use this configuration -->
<dubbo:provider networker="xxx" /> 

Known Extensions

  • org.apache.dubbo.remoting.p2p.support.MulticastNetworker
  • org.apache.dubbo.remoting.p2p.support.FileNetworker

Extension Example

Maven project structure:

src
 |-main
    |-java
        |-com
            |-xxx
                |-XxxNetworker.java (implements Networker interface)
    |-resources
        |-META-INF
            |-dubbo
                |-org.apache.dubbo.remoting.p2p.Networker (plain text file, content: 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