alan2016llg commented on issue #2714:
URL: https://github.com/apache/dubbo-go/issues/2714#issuecomment-2247781505

   @FoghostCn 我这边是泛化调用,配置的是双注册方式,配置如下:
   `nacosregistryConfig := &config.RegistryConfig{
                Protocol:  "nacos",
                Address:   "localhost:8848,", 
                Timeout:   "10s",
                Username:  "nacos",
                Password:  "nacos",
                Namespace: "dev_dubbo",
                Preferred: true,
        }
        zkegistryConfig := &config.RegistryConfig{
                Protocol:  "zookeeper",
                Address:   "localhost:2181", 
                Timeout:   "10s",
                Preferred: false,
        }
   
        method := config.MethodConfig{InterfaceName: iface, Retries: "0"}
        methods := []*config.MethodConfig{&method}
        refConf := config.ReferenceConfig{
                InterfaceName:  iface,
                Cluster:        "failover",
                RegistryIDs:    []string{"nacos", "zk"},
                Protocol:       protocol,
                Generic:        "true",
                Methods:        methods,
                Version:        "1.0",
                RequestTimeout: "9s",
                ProvidedBy:     "example-dubbo",
        }
   
        rootConfig := config.NewRootConfigBuilder().
                AddRegistry("nacos", nacosregistryConfig).
                AddRegistry("zk", zkegistryConfig).
                Build()
        if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
                panic(err)
        }
        _ = refConf.Init(rootConfig)
        refConf.GenericLoad("example-dubbo")`


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to