使用 Profile 覆盖属性

覆盖来自 Config Server 的属性的最后一种方法是在客户端应用程序中的 profile 特定配置文件中指定它们。

例如,如果您从 Config Server 获取了以下配置

hello="Hello From Config Server!"

您可以通过在 profile 特定配置文件中设置 hello 并启用该 profile 来覆盖客户端应用程序中 hello 的值。

application-overrides.properties
hello="Hello From Application!"

在上面的示例中,您必须启用 overrides profile。