So I recently learned this awesome config service of Spring Cloud, and after some struggling I\'m able to get our distributed application set up, with multiple nodes reading con
From the Overriding the Values of Remote Properties section in the official documentation:
The property sources that are added to you application by the bootstrap context are often "remote" (e.g. from a Config Server), and by default they cannot be overridden locally, except on the command line. If you want to allow your applications to override the remote properties with their own System properties or config files, the remote property source has to grant it permission by setting
spring.cloud.config.allowOverride=true
(it doesn’t work to set this locally).Once that flag is set there are some finer grained settings to control the location of the remote properties in relation to System properties and the application’s local configuration:
spring.cloud.config.overrideNone=true
to override with any local property source, andspring.cloud.config.overrideSystemProperties=false
if only System properties and env vars should override the remote settings, but not the local config files.
So, you can set the following configurations in the remote application.yml
(e.g. remote git repository) to allow local override of remote properties.
spring:
cloud:
config:
allowOverride: true
overrideNone: true
overrideSystemProperties: false