Closed zhaoyunxing92 closed 4 years ago
需要确保本地没有填写server.port属性
我本地只设置了apollo的配置,其他都在apollo上配置的
可以参考一下spring-cloud-zuul
现在问题是application.yml不行,只能用application.properties
我使用spring-cloud-zuul测试了是没问题的
http://106.12.25.204:8070/config.html?#/appid=spring-cloud-zuul
server:
port: 9090
zuul:
routes:
test:
path: /**
url: https://github.com
application.yml
配置@EnableApolloConfig("application.yml")
application.yml
的变化这步非必须,只是为了能监听配置变化,重新刷新zuul的路由
@ApolloConfigChangeListener(interestedKeyPrefixes = "zuul.", value = "application.yml")
public void onChange(ConfigChangeEvent changeEvent) {
refreshZuulProperties(changeEvent);
}
配置application.properties中的apollo.meta
地址
启动程序
程序会以前面配置的端口启动
好的,十分感谢,我等下再试试看
客户端1.5.1,在配置文件中配置apollo.bootstrap.namespaces: application,application.yml 读取不到application.yml namespace中的配置 用@EnableApolloConfig("application.yml")这个是可以的;不知道是什么原因!
@couples 打开debug日志看看
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.
我用1.4.0的版本,但是yml文件不起用,文件已经拉倒本地了
yml配置
拉取的配置信息