Overriding Properties Using Placeholders
不启用配置 first bootstrap,覆盖属性的更干净的方法是在来自配置服务器的配置中使用属性占位符。
A cleaner way to override properties without enabling config first bootstrap is to use property placeholders in the configuration coming from the config server.
例如,如果来自配置服务器的配置包含以下属性
For example if the configuration coming from the config server contains the following property
hello=${app.hello:Hello From Config Server!}
您可以通过在本地应用配置中设置 app.hello
,覆盖来自配置服务器的 hello
的值
You can override the value of hello
coming from the config server by setting app.hello
in your local application configuration
app.hello=Hello From Application!