使用配置文件覆盖属性
覆盖来自配置服务器的属性的最后一种方法是在客户端应用程序中指定 profile 特定的配置文件中的属性。
例如,如果您有来自配置服务器的以下配置:
hello="Hello From Config Server!"
您可以通过在 profile 特定的配置文件中设置 hello 并启用该 profile 来覆盖客户端应用程序中 hello 的值。
application-overrides.properties
hello="Hello From Application!"
在上面的示例中,您需要启用 overrides profile。