It’s only used/needed if you’re using Spring Cloud and your application’s configuration is stored on a remote configuration server (e.g. Spring Cloud Config Server).
two options
- bootstarp is loaded before application.
- when use spring cloud server , by setting
spring.application.name
andspringcloud server address
to load external properties
that get some question
- why Config Server need to put these parameters into bootstrap.yml?
- because of priority,default application context can’t load external properteies , so spring cloud have to add a parent application baseing on bootstrap.yml
- A Spring Cloud application operates by creating a “bootstrap” context, which is a parent context for the main application. Out of the box it is responsible for loading configuration properties from the external sources, and also decrypting properties in the local external configuration files.