This commit is contained in:
parent
4c56d907ed
commit
5c718886bd
5
main.go
5
main.go
@ -22,7 +22,7 @@ func initNacos() {
|
||||
}
|
||||
cc := constant.ClientConfig{
|
||||
AppName: "api1",
|
||||
NamespaceId: "public", //namespace id
|
||||
NamespaceId: "", //namespace id
|
||||
TimeoutMs: 5000,
|
||||
NotLoadCacheAtStart: true,
|
||||
RotateTime: "1h",
|
||||
@ -47,6 +47,7 @@ func initNacos() {
|
||||
Port: pp,
|
||||
Weight: 10,
|
||||
Enable: true,
|
||||
Healthy: true,
|
||||
ServiceName: "api1",
|
||||
Ephemeral: true,
|
||||
})
|
||||
@ -63,7 +64,7 @@ func initNacos() {
|
||||
DataId: "api.yml",
|
||||
Group: "DEFAULT_GROUP",
|
||||
OnChange: func(namespace, group, dataId, data string) {
|
||||
fmt.Println("group:" + group + ", dataId:" + dataId + ", data:" + data)
|
||||
fmt.Println("监控到配置文件变动: group:" + group + ", dataId:" + dataId + ", data:" + data)
|
||||
},
|
||||
})
|
||||
//log.Println("监听配置失败: ", err.Error())
|
||||
|
Loading…
Reference in New Issue
Block a user