1.nacos dataID规则:
通过dataID读取配置:dataId默认规则是
${prefix}-${spring.profiles.active}.${file-extension}
1.prefix在没有配置spring.cloud.nacos.config.prefix属性默认是spring.application.name
2.spring.profiles.active就是当前的运行环境,dev,test等
3.file-extension为配置文件的后缀,yaml和properties
注意:如果spring.profiles.active不存在dataId=${prefix}.${file-extension}
注意:nacos在加载配置的时候会加载两个配置,分别是dataId为:
${prefix}.${file-extension}
${prefix}-${spring.profiles.active}.${file-extension}
2.读取多个配置
3.共享配置