跳到主要内容

使用占位符覆盖属性

DeepSeek V3 中英对照 Overriding Properties Using Placeholders

在不首先启用配置引导的情况下,覆盖属性的更简洁方法是使用来自配置服务器的配置中的属性占位符。

例如,如果来自配置服务器的配置包含以下属性

hello=${app.hello:Hello From Config Server!}
properties

你可以通过在本地应用程序配置中设置 app.hello 来覆盖从配置服务器获取的 hello 值。

app.hello=Hello From Application!
properties