External Configuration in Microservices: Spring Cloud Config

Ruby Valappil
Javarevisited
Published in
3 min readDec 19, 2021

--

Let’s take a look at the overall microservice architecture that we have built as part of this spring cloud series.

Microservice Architecture using Spring Cloud Components

If you have not followed this Spring Cloud series from the beginning, check this index page and bookmark it if needed — Spring Cloud Tutorials.

Why Spring Cloud Config?

When we build a service, there are many values that we don’t want to hardcode and rather read from property files, for instance, endpoints, encrypted values, etc.

If we rely on the property files that are part of the application jar then for each configuration change we will have to rebuild the jar which is a tedious job. So instead, we can add all the properties in an external system like git, svn, etc, and just access them from our services and also enable the services to refresh dynamically when a property is added or edited in the external system.

Implementation

To implement and test an external config server configuration, just 2 services are needed— Config Server and Config Client but in this tutorial, we will continue using the existing services that were mentioned in the previous articles. (Clone the projects mentioned in the conclusion section of Open Feign Tutorial).

--

--