美文网首页
使用 Nacos 配置中心时 Nacos 动态配置文件加载不上

使用 Nacos 配置中心时 Nacos 动态配置文件加载不上

作者: YUNDONG丶 | 来源:发表于2019-11-18 20:39 被阅读0次

使用 properties 格式时


bootstrap.properties 只需要写成
# 对应的 Nacos Cofig 中的 Data ID
spring.application.name=spring-cloud-alibaba-nacos-consumer-feign
# Nacos Server 的地址
spring.cloud.nacos.config.server-addr=127.0.0.1:8848

使用 yaml


bootstrap.properties 只需要写成
# 对应的 Nacos Cofig 中的 Data ID
spring.application.name=spring-cloud-alibaba-nacos-consumer-feign
# 指定名为 spring-cloud-alibaba-nacos-provider.yaml 的配置文件
spring.cloud.nacos.config.file-extension=yaml
# Nacos Server 的地址
spring.cloud.nacos.config.server-addr=127.0.0.1:8848

扩展内容
github
个人博客

相关文章

网友评论

      本文标题:使用 Nacos 配置中心时 Nacos 动态配置文件加载不上

      本文链接:https://www.haomeiwen.com/subject/gwabictx.html