Skip to content

Commit f29198b

Browse files
author
Dave Syer
committed
Clarify flags for overriding remote property sources
1 parent 81b4c11 commit f29198b

File tree

1 file changed

+20
-1
lines changed

1 file changed

+20
-1
lines changed

docs/src/main/asciidoc/spring-cloud-commons.adoc

Lines changed: 20 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ the external sources, and also decrypting properties in the local
2828
external configuration files. The two contexts share an `Environment`
2929
which is the source of external properties for any Spring
3030
application. Bootstrap properties are added with high precedence, so
31-
they cannot be overridden by local configuration.
31+
they cannot be overridden by local configuration, by default.
3232

3333
The bootstrap context uses a different convention for locating
3434
external configuration than the main application context, so instead
@@ -123,6 +123,25 @@ context you are building) then properties in that profile will be
123123
loaded as well, just like in a regular Spring Boot app, e.g. from
124124
`bootstrap-development.properties` for a "development" profile.
125125

126+
[[overriding-bootstrap-properties]]
127+
=== Overriding the Values of Remote Properties
128+
129+
The property sources that are added to you application by the
130+
bootstrap context are often "remote" (e.g. from a Config Server), and
131+
by default they cannot be overridden locally, except on the command
132+
line. If you want to allow your applications to override the remote
133+
properties with their own System properties or config files, the
134+
remote property source has to grant it permission by setting
135+
`spring.cloud.config.allowOverride=true` (it doesn't work to set this
136+
locally). Once that flag is set there are some finer grained settings
137+
to control the location of the remote properties in relation to System
138+
properties and the application's local configuration:
139+
`spring.cloud.config.overrideNone=true` to override with any local
140+
property source, and
141+
`spring.cloud.config.overrideSystemProperties=false` if only System
142+
properties and env vars should override the remote settings, but not
143+
the local config files.
144+
126145
=== Customizing the Bootstrap Configuration
127146

128147
The bootstrap context can be trained to do anything you like by adding

0 commit comments

Comments
 (0)