bootstrapProperties                                             #来自configServer的值
commandLineArgs                                                 #命令行参数
servletConfigInitParams                                         
servletContextInitParams                                        
systemProperties                                                
systemEnvironment                       
random      
applicationConfig: [classpath:/application.yml]
springCloudClientHostInfo
applicationConfig: [classpath:/bootstrap.yml]
defaultProperties
Management Server

上面的排序是通过 implements ApplicationListener<ApplicationPreparedEvent> 然后打印出来的。

通过上面的顺序,我们可以知道,Spring想要得到一个配置的值,就按照上面的顺序一个个去找,找到就直接返回。由于Spring cloud ConfigServer处于最优先级,本地项目不管怎么设置都不能覆盖

相关文章:

  • 2021-09-18
  • 2021-10-03
  • 2022-12-23
  • 2022-12-23
  • 2021-10-27
  • 2021-09-12
  • 2021-05-19
  • 2022-12-23
猜你喜欢
  • 2021-09-24
  • 2021-06-26
  • 2021-06-18
  • 2022-12-23
  • 2021-12-21
  • 2022-01-27
相关资源
相似解决方案