掘金 后端 ( ) • 2021-10-24 10:42
source= propertySourceLocator.locate(environment)。
PropertySourceLocator 接口作用是实现应用外部化配置可动态加载,而NacosPropertySourceLocator实现了这个接口,locator.locate调用的是NacosPropertySourceLocator的locate方法。
Spring Cloud Alibaba Nacos Config 中通过Context.getEnvironment.getProperty("Key")获取Nacos Config服务器上的数据,重点的实现类是NacosPropertySourceLocator,方法中包含locate(), ... 阅读全文