Book Image

Spring Boot Cookbook

By : Alex Antonov
Book Image

Spring Boot Cookbook

By: Alex Antonov

Overview of this book

Table of Contents (15 chapters)
Spring Boot Cookbook
Credits
About the Author
Acknowledgment
About the Reviewers
www.PacktPub.com
Preface
Index

Externalizing environmental config using property files


The previous recipe taught us about the application properties and how they are provisioned. As was mentioned in the beginning of this chapter, during application deployment, it is almost inevitable to have some property values that are environment dependant. They can be database configurations, service topologies, or even simple feature configurations where something might be enabled in development but not quite ready for production just yet.

In this recipe, we will learn how to use an externally residing properties file for an environment-specific configuration, which might reside in the local filesystem or out in the wild on the Internet.

In this recipe, we will use the same application with all the existing configurations as we did in the previous recipe. We will use it to see how to consume external properties when we launch our application using the external configuration properties that are living in the local filesystem and from...