此版本仍在开发中,尚未被视为稳定版本。对于最新的稳定版本,请使用 Spring Cloud Config 4.1.4spring-doc.cadn.net.cn

使用占位符覆盖属性

在不启用 config first bootstrap 的情况下覆盖属性的一种更简洁的方法是在来自 config server 的配置中使用属性占位符。spring-doc.cadn.net.cn

例如,如果来自配置服务器的配置包含以下属性spring-doc.cadn.net.cn

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

您可以覆盖hello通过设置app.hello在本地应用程序配置中spring-doc.cadn.net.cn

app.hello=Hello From Application!