import(
"dubbo.apache.org/dubbo-go/v3/config"
"dubbo.apache.org/dubbo-go/v3/config/generic"
_ "dubbo.apache.org/dubbo-go/v3/imports"
hessian "github.com/apache/dubbo-go-hessian2"
)
regConf := &config.RegistryConfig{
Protocol: "zookeeper",
Timeout: "3s",
Group: "zk_srver_admin",
Namespace: "zk_srver",
Address: "xxxx:2181,xxxx1:2181,xxxx2:2181,xxx3:2181,xxxx4:2181",
RegistryType: "interface",
}
refConf := config.ReferenceConfig{
InterfaceName: "com.domain.test.info.api.TestQueryApi",
Cluster: "failover",
Protocol: dubbo.DUBBO,
RegistryIDs: []string{"zk"},
ProvidedBy: "providers",
Generic: "true",
Version: "1.0.0",
}
rootConf := config.NewRootConfigBuilder().
SetApplication(&config.ApplicationConfig{
Name: "app_name",
Owner: "xxxx",
}).
AddRegistry("zk", regConf).
Build()
if err := config.Load(config.WithRootConfig(rootConf)); err != nil {
panic(err)
}
_ = refConf.Init(rootConf)
refConf.GenericLoad("app_name")
resp, err := refConf.GetRPCService().(*generic.GenericService).Invoke(
context.TODO(),
"getTestInfo",
[]string{"java.util.List"},
[]hessian.Object{
[]hessian.Object{
map[string]hessian.Object{"testId": "testId001", "serId": "1710394936000"},
map[string]hessian.Object{"testId": "testId002", "serId": "1710748418000"},
},
},
)
if err != nil {
panic(err)
}
启动后,有三个 warn 信息
### 1
extension/registry_directory.go:60 registry directory zookeeper does not exist, make sure you have import the package, will use the default directory type.
### 2
tag/router.go:52 [tag router] invokers from previous router is empty.
### 3 error
proxy/proxy.go:212 [CallProxy] received rpc err: Failed to invoke the method $invoke. No provider available for the service dubbo://:@:/?interface=com.domain.test.info.api.TestQueryApi&group=&version=1.0.0 from registry zookeeper://xxxx:2181?registry=zookeeper®istry.group=zk_srver_admin®istry.label=true®istry.namespace=zk_server®istry.preferred=false®istry.role=0®istry.timeout=3s®istry.ttl=15m®istry.weight=0®istry.zone=&remote-client-name=dubbo.registries-zookeeper-xxx%3A2181%2Cxxxx1%3A2181%2Cxxxx2%3A2181%2Cxxxx3%3A2181%2Cxxxx4%3A2181&simplified=false on the consumer xxx.xxx.xxx.xxx using the dubbo version 3.1.1 .Please check if the providers have been started and registered.
还请大佬帮看看是什么问题呢?
启动后,有三个 warn 信息
还请大佬帮看看是什么问题呢?