Comments (5)
修改apollo的配置后,有没有发布配置
from agollo.
修改apollo的配置后,有没有发布配置
有发布。不修改apollo配置。在select中也只能打印出最初的一次值
from agollo.
可以加入日志的参数选项,开启日志,看看具体出现了什么异常。
agolloClient, err := agollo.New(
"localhost:8080",
"SampleApp",
agollo.WithLogger(agollo.NewLogger(agollo.LoggerWriter(os.Stdout))),
agollo.AutoFetchOnCacheMiss(),
agollo.PreloadNamespaces("application", "TEST1.json"),
)
我用上面你给的代码,测试过了是可以的。你再检查下namspace的名字是否正确。
package main
import (
"fmt"
"os"
"time"
"github.com/shima-park/agollo"
)
func main() {
agolloClient, err := agollo.New(
"localhost:8080",
"SampleApp",
agollo.WithLogger(agollo.NewLogger(agollo.LoggerWriter(os.Stdout))),
agollo.AutoFetchOnCacheMiss(),
agollo.PreloadNamespaces("test.json", "TEST1.json.json"),
)
if err != nil {
panic(err)
}
fmt.Println(agolloClient.GetNameSpace("TEST1.json.json"), agolloClient.GetNameSpace("test.json"))
errChan := agolloClient.Start()
watchChan := agolloClient.Watch()
ticker := time.NewTicker(5 * time.Second)
for {
select {
case <-ticker.C:
fmt.Println("Ticker:",
"TEST1.json.json", agolloClient.GetNameSpace("TEST1.json.json"), "\n",
"test.json", agolloClient.GetNameSpace("test.json"),
)
case err := <-errChan:
fmt.Println(err, 0)
case resp := <-watchChan:
fmt.Println("Notify:", resp, 0)
}
}
}
图中第二个namespace: TEST1.json 实际namespace是 TEST1.json.json
后面两个namespace: test.json, test.yaml
from agollo.
我尝试加了日志,还是不正常。能监听到了,但值没有被修改
from agollo.
你就用我上一个回复贴的示例代码,改成你的配置试试看。
还有库的tag你看是不是最新的版本v1.2.7
from agollo.
Related Issues (20)
- agollo v1.2.8, 启用从备份文件加载时, 在调用GetNameSpace(key)正常时, 会将备份文件的其他namespace的数据删除 HOT 1
- 能否为ApolloClient提供自定义签名入口 HOT 8
- 我不想要备份文件, 可以去掉么, 它无论如何都会创建一个备份文件我关不掉 HOT 6
- go mod tidy 报错 HOT 4
- 此客户端是如何支持多环境配置的? HOT 1
- can't get value by Env? HOT 2
- 没有贡献值不开心啊 HOT 4
- apollo中使用yaml格式的配置文件,viper读取为空 HOT 3
- 与viper 一起用时候怎么切换或者说选择apollo的cluster呢 HOT 4
- 为什么app.properties文件下储存的是json格式而不是property格式? HOT 1
- 为什么除了properties类型的数据能拉到,其他Json,Yaml的都拉不出来呢? HOT 1
- 用golang 1.18构建后拉不到配置,1.17正常。 HOT 5
- 可否加一个关闭备份选项
- 使用viper时,是否能暴露一个配置变更的方法 HOT 2
- agollo.Start()和viper同用时,配置变更后的读取操作会存在并发问题 HOT 1
- viper说明文档 好像不全 HOT 1
- viper 支持 secretKey HOT 1
- 签名计算bug HOT 3
- 启动后提示函数time.UnixMilli()错误
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from agollo.