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 and springcloud server addressto 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.

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

    https://cloud.spring.io/spring-cloud-static/spring-cloud-commons/2.1.1.RELEASE/single/spring-cloud-commons.html#_application_context_hierarchies