Configure Config Service and Load Configuration to other services

Code Dexterous
2 min readJul 12, 2020

So now we are going to move our configurations of services to a centralized location and check it works or not.

When we choose filesystem as a configuration and we choose classpath then application.properties cannot be used to server same configuration to all but in case we choose file:// then we can create application.properties for common configuration.

Now create two properties files gateway-service.properties and user-service.properties name of the file is based on the name of the application given in application.properties of the services. In case if you change the name of the application (spring.application.name) then you also have to rename the file.

Move configuration from individual services to corresponding files.

User Service

application.properties
user-service.properties

Gateway Service

application.properties
gateway-service.properties

Now restart Config Service and then restart Gateway Service and User Service and it will works as before.

--

--

Code Dexterous

I am full stack developer. Works on different technology and lean to learn more.