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.

Similar Reads

Usage of application.yml

This is the main configuration file used by the Spring Boot application. It contains configuration properties specific to the application. Properties are defined here as loaded after bootstrap.yml is loaded....

Usage of bootstrap.yml

It is particularly used for setting external configurations like Environment-specific properties. Properties are defined here as loaded before application.yml is loaded. It is mostly used in microservices architectures to manage independently from the application code....

Difference between application.yml and bootstrap.yml

...