tree: 394df8dfc2d2c041cbcc11122a2ef1bc8ffe7b10 [path history] [tgz]
  1. go-client/
  2. go-server/
  3. README.md
  4. README_zh.md
multi-registry/README.md

Multi Registry Example

Backend

dubbo-go supports simultaneous registration of the same service with multiple registries, or separate registration of different services in different registries, or even simultaneous reference of services with the same name registered in different registries. In addition, the registry supports custom extensions. I use zk and nacos in this sample.

Code

Config

# registry config
registries:
  "zk":
    protocol: "zookeeper"
    timeout: "3s"
    address: "127.0.0.1:2181"
  "nacos":
    protocol: "nacos"
    timeout	: "3s"
    address: "127.0.0.1:8848"

# reference config
references:
  "UserProvider":
    registry: "zk,nacos"
    protocol: "dubbo"
    interface: "org.apache.dubbo.UserProvider"
    cluster: "failover"
    methods:
      - name: "GetUser"
        retries: 3

Pls. refer to HOWTO.md under the root directory to run this sample.