我在application.yml中定义了一个映射,并希望在环境变量或另一个application-profile.yml中完全覆盖它。
例如,此应用程序。yml:
zuul:
routes:
foobar:
path: /foo
serviceId: bar
和此application-test.yml:
zuul:
routes:
test:
path: /test
serviceId: test
如果我使用活动配置文件测试运行该命令,则会得到一个zuul.routes,其中包含/ test和/ foobar这两个路由。当您需要在多个级别添加路由时,这很好,但是我的用例将相反。当测试配置文件处于活动状态时,我不需要考虑/ foobar路由,因此我只获得/ test路由。
从我在documentation中看到的情况看来,这似乎是不可能的。反正有实现这一目标的方法吗?