Spring Boot environment configuration, hierarchy, and precedence

In the previous few recipes, we looked at how to package our application in a variety of ways and how it can be deployed. The next logical step is the need to configure the application in order to provide some behavioral control as well as some environment-specific configuration values, which could and most likely will vary from environment to environment.

A common example of such an environmental configuration difference is the database setup. We certainly don't want to connect to a production environment database with an application running on our development machine. There are also cases where we want an application to run in different modes or use a different set of profiles, as they are referred to by Spring. An example could be running an application in live or simulator mode.

For this recipe, we will pick up from the previous state of the code base and add the support for different configuration profiles as well as examine how to use the property values as placeholders in other properties.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.218.129.100