Difference between application.yml and bootstrap.yml
Aspect |
application.yml |
bootstrap.yml |
---|---|---|
Purpose |
Main configuration file for application specific settings. |
Configuration file for setting up the application context before the application is created. |
Loading Order |
Loaded after bootstrap.yml properties. |
Loaded before application.yml properties. |
Configuration Scope |
Application-specific |
Primarily used for configuring external configuration sources or common settings across applications. |
Typical Use Cases |
Application-specific settings, default configurations, environment specific settings. |
Configuring Spring Cloud Config Server URI, setting up external configuration sources, common settings across multiple applications. |
application.yml vs bootstrap.yml in Spring Boot
In this article, we will discuss application.yml vs bootstrap.yml in Spring Boot and how application.yml or bootstrap.yml are useful in Application development. The application.yml is auto-configured by the Spring Boot framework to handle the development but for the bootstrap.yml we need to configure it externally in Spring Boot. The application.yml or application.properties file configures the application context and bootstrap.yml file is used to configure the bootstrap context.