SpringBoot集成nacos配置中心源码

nacos config包主要引入了以下几个依赖(初始化组件)

org.springframework.cloud.bootstrap.BootstrapConfiguration=\
com.alibaba.cloud.nacos.NacosConfigBootstrapConfiguration
org.springframework.boot.autoconfigure.EnableAutoConfiguration=\
com.alibaba.cloud.nacos.NacosConfigAutoConfiguration,\
com.alibaba.cloud.nacos.endpoint.NacosConfigEndpointAutoConfiguration
org.springframework.boot.diagnostics.FailureAnalyzer=\
com.alibaba.cloud.nacos.diagnostics.analyzer.NacosConnectionFailureAnalyzer
  1. NacosConfigBootstrapConfiguration

public class NacosConfigBootstrapConfiguration {

    @Bean
    @ConditionalOnMissingBean
    //初始化application里配置的参数
    public NacosConfigProperties nacosConfigProperties() {
        return new NacosConfigProperties();
    }

    @Bean
    @ConditionalOnMissingBean
    //初始化一个NacosConfigManager 
    public NacosConfigManager nacosConfigManager(
            NacosConfigProperties nac
上一篇:(二十)、SpringCloud Alibaba Seata处理分布式事务


下一篇:(十九)、SpringCloud Alibaba Sentinel实现熔断和限流