领事优先于弹簧轮廓

时间:2019-03-04 16:21:10

标签: spring-cloud consul

我正在将配置文件移至领事。配置文件保存在领事上的yaml中。这是配置yaml文件的一部分(如您所见,有2个配置文件DEV,DEV2):

---
spring
  profiles: DEV2

environment:
  current: DEV2

urls:
  de: http://10.11.22.44
  be: http://10.11.22.44
---
spring:
  profiles: DEV

environment:
  current: DEV

urls:
  de: http://10.11.22.33
  be: http://10.11.22.33

问题在于,当我使用概要文件DEV2运行应用程序时。始终使用配置文件DEV中的网址(因为它们在yaml文件中较低)。有没有办法强制领事从DEV2配置文件读取数据?这是我的引导yaml配置:

spring:
  cloud:
    consul:
      host: 10.11.22.33
      port: 8500
      config:
        name: config
        acl-token: sometoken
        prefix: someprefix
        format: yaml

0 个答案:

没有答案