Overriding Properties Using Profiles

覆盖来自配置服务器的属性的最后一种方法是把它们指定在客户端应用中的配置配置文件中。

The final way to override properties coming from the config server is to specify them in profile specific configuration file within the client application.

例如,如果您有以下来自配置服务器的配置

For example, if you have the following configuration from the config server

hello="Hello From Config Server!"

您可以通过在配置配置文件中设置 hello 并启用该配置文件,在客户端应用中覆盖 hello 的值。

You can override the value of hello in the client application by setting hello in a profile specific configuration file and then enabling that profile.

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

在以上示例中,您必须启用 overrides 配置文件。

In the above example you would have to enable the overrides profile.