What is the difference between putting a property on application.yml or bootstrap.yml in spring boot

https://stackoverflow.com/questions/32997352/what-is-the-difference-between-putting-a-property-on-application-yml-or-bootstra

I have just asked the Spring Cloud guys and thought I should share the info I have here.

bootstrap.yml is loaded before application.yml.

It is typically used for the following:

when using Spring Cloud Config Server, you should specify spring.application.name and spring.cloud.config.server.git.uri inside bootstrap.yml
some encryption/decryption information

Technically, bootstrap.yml is loaded by a parent Spring ApplicationContext. That parent ApplicationContext is loaded before the one that uses application.yml.

发布了83 篇原创文章 · 获赞 0 · 访问量 845

猜你喜欢

转载自blog.csdn.net/michaelforgood/article/details/103600377
今日推荐