Closed nangergong closed 4 years ago
这个日志是说加载不到application这个namespace,并不是说没有加载config.yml这个namespace。
看下代码中应该是指定了加载application了,比如@EnableApolloConfig
和@ApolloConfigChangeListener
默认是加载application的。
这个日志是说加载不到application这个namespace,并不是说没有加载config.yml这个namespace。
看下代码中应该是指定了加载application了,比如
@EnableApolloConfig
和@ApolloConfigChangeListener
默认是加载application的。
不能在配置文件制定加载其他namespace吗?不能的话这个apollo.bootstrap.namespaces有啥用?
可以指定,我前面的回答不是说apollo没加载config.yml
,而是说从日志上可以判断你在别的地方指定了加载application
。
我也有这个问题 apollo.bootstrap.namespaces 无论怎么指定 最后还是只加载 application
请问这个问题您解决了么 @nangergong
我也遇到类似的问题。 一个工程关联多个namespace,配置如下:
apollo.bootstrap.namespaces=application.yml,baseconfig
对应 app.id 下也存在对应namespace 。application.yml 为私有的,baseconfig 为public的。
apollo 版本: server:1.3.0 client :1.3.0
对应log如下:
2020-03-13 17:00:18.068 WARN [cas-**,] Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: cas-**, cluster: default, namespace: application.yml,baseconfig, url: http://10.1.41.129:8091/configs/cas-**/default/application.yml,baseconfig?ip=172.22.0.4 [Cause: [status code: 404] Could not find config for namespace - appId: cas-**, cluster: default, namespace: application.yml,baseconfig, please check whether the configs are released in Apollo!]
@nobodyiam 有的有的。之前调试的时候,就看到了。 符号是英文的 只是不影响运行,所以也没太在意。但是一直 print warn 还是很烦
apollo 版本: server:1.3.0 client :1.3.0
@nobodyiam
initialize 方法中的 List
这个不应该啊,是否能上传一个最简的demo可以复现该问题的?
好的。我这两天加一个demo复现一下
感谢 顺哥。问题已经定位,不是apollo的问题。导致问题的原因应该是集成nexpion-disovery 后,配置方式不合理导致。
不过顺哥,我还是要请教一句。 1、每个工程必须要有一个默认的application namesapces 吗? 现在WARN 提示的场景 就是对应project 没有 application namesapces,然后就会一直 WARN。。 2、另外,如果通过 apollo.bootstrap.enabled=true 配置 namespace后,是不是就不用 @EnableApolloConfig 注解了 ?
apollo.bootstrap.enabled=true
apollo.bootstrap.eagerLoad.enabled=true
apollo.bootstrap.namespaces=application.yml,baseconfig
1、每个工程必须要有一个默认的application namesapces 吗? 不是,如果报WARN的话,说明代码中有配置过加载application namespace,比如不带参数的@EnableApolloConfig,不带参数的@ConfigChangeListener
This issue has been automatically marked as stale because it has not had activity in the last 90 days. It will be closed in 14 days unless it is tagged "help wanted" or other activity occurs. Thank you for your contributions.
This issue has been automatically closed because it has not had activity in the last 14 days. If this issue is still valid, please ping a maintainer and ask them to label it as "help wanted". Thank you for your contributions.
试下@EnableApolloConfig(value = {"你的自定义命名空间"})
Describe the bug
我用springboot,在application.yml中有如下配置
启动程序后, 报错如下,我发现这个连接“http://149.218.9.160:9180/configs/user/default/application?ip=192.168.2.212” 中app.id取了上面的配置,但是namespace没有取用config.yml,而是总是用application,我改了app.id和namespaces实验多次,发现就是app.id有效,namespaces无效,请问如何解决这个问题?
` 2019-12-13 13:19:10.545 WARN 9320 --- [ main] c.c.f.a.i.AbstractConfigRepository : Sync config failed, will retry. Repository class com.ctrip.framework.apollo.internals.RemoteConfigRepository, reason: Load Apollo Config failed - appId: didi, cluster: default, namespace: application, url: http://149.218.9.160:9180/configs/user/default/application?ip=192.168.2.212 [Cause: [status code: 404] Could not find config for namespace - appId: user, cluster: default, namespace: application, please check whether the configs are released in Apollo!]
`