WPZC commented on issue #2438:
URL: https://github.com/apache/dubbo-go/issues/2438#issuecomment-1751881088
> 您能否提供代码示例和更具体的上下文?
This is my startup code
```go
// 设置provider
config.SetProviderService(&cususer.ListTestUserListProvider{})
// 以 API 的形式来启动框架
rootConfig := config.NewRootConfigBuilder().
SetConfigCenter(config.NewConfigCenterConfigBuilder().
SetProtocol(dubboConfigCenter.Protocol).
SetAddress(dubboConfigCenter.Address). //
根据配置结构,设置配置中心
SetDataID(dubboConfigCenter.RootDataId). // 设置配置ID
SetGroup(dubboConfigCenter.Group).
Build()).
Build()
logger.Info("启动dubbo服务addr:", dubboConfigCenter.Address)
if err := config.Load(config.WithRootConfig(rootConfig)); err != nil {
panic(err)
}
```
This is my configuration
```
dubbo:
# Dubbo 框架标准监控指标
metrics:
enable: true # default is true
port: 9091
application: # 应用信息,服务启动后会将相关信息注册到注册中心,可被客户端从 url 中识别
# application=myApp; name=myApp
name: myApp
# module=opensource
module: gouser
# organization=dubbo
organization: dubbo-gouser
# owner=laurence
owner: laurence
# app.version=myversion
version: 1.0.0-rc
# environment=pro
environment: pro
registries:
nacos:
protocol: nacos
address: go.galaxyspacetime.com:8848
# nacos group, 默认 DEFAULT_GROUP
group: myGroup
# nacos namespaceID, should be created before. 默认public
namespace: 9fb00abb-278d-42fc-96bf-e0151601e4a1
# username: abc
# password: abc
protocols:
triple:
name: tri
port: 21001
#服务提供者
provider:
services:
ListTestUserListProvider:
# read from stub
interface: "com.gouser.api.v1.myapp"
# 默认为空
version: 1.0.1
# 默认为空
group: myGroup
```
--
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]