firstpersonl opened a new issue #1558:
URL: https://github.com/apache/dubbo-go/issues/1558
mycode
```
import (
"context"
"dubbo.apache.org/dubbo-go/v3/common/logger"
"dubbo.apache.org/dubbo-go/v3/config"
_ "dubbo.apache.org/dubbo-go/v3/imports"
"dubbo_go_demo/api"
)
func main() {
config.SetProviderService(&GreeterProvider{})
applicationConfig :=
config.NewApplicationConfigBuilder().SetModule("provider-1").SetMetadataType("remote").Build()
metadataReportConfig := config.NewMetadataReportConfigBuilder().
SetProtocol("nacos").
SetMetadataType("remote").
SetAddress("127.0.0.1:8848").SetTimeout("3s").SetGroup("public").SetUsername("nacos").SetPassword("nacos").Build()
rc := config.NewRootConfigBuilder().
SetProvider(config.NewProviderConfigBuilder().
AddService("GreeterProvider",
config.NewServiceConfigBuilder().
SetInterface("org.apache.dubbo.UserProvider").
SetProtocolIDs("tripleProtocolKey").
Build()).
SetRegistryIDs("registryKey").
Build()).
AddProtocol("tripleProtocolKey",
config.NewProtocolConfigBuilder().
SetName("tri").
Build()).
AddRegistry("registryKey",
config.NewRegistryConfigBuilder().
SetProtocol("nacos").
SetAddress("127.0.0.1:8848").
SetTimeout("3s").
SetGroup("public").
SetUsername("nacos").
SetPassword("nacos").
SetRegistryType("service").
Build()).
SetApplication(applicationConfig).
SetMetadataReport(metadataReportConfig).
Build()
if err := rc.Init(); err != nil {
panic(err)
}
select {}
}
```
问题分析:
registry/nacos.newNacosServiceDiscovery使用了config.Load()所填充的私有属性的配置
--
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]