multi-registry/

directory
v1.5.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 4, 2022 License: Apache-2.0

README

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.

Directories

Path Synopsis
go-client
cmd
pkg
go-server
cmd
pkg

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL