spring cloud config-client怎么同时读取多个文件

spring.application.name=config-client
[color=red][b]spring.cloud.config.name=config-client,zuul //此处指定多个文件名即可[/b][/color]
spring.cloud.config.label=master
spring.cloud.config.server.git.searchPaths=
spring.cloud.config.profile=dev
#spring.cloud.config.uri= http://localhost:8888/

eureka.client.serviceUrl.defaultZone=http://peer1:1111/eureka/,http://peer1:1112/eureka/
spring.cloud.config.discovery.enabled=true
spring.cloud.config.discovery.serviceId=config-server
server.port=8881

##config
spring.cloud.test1=hello world1
spring.cloud.test2=hello world2


ps:
config-server:可以支持匹配特定的部分文件
spring:
  cloud:
    config:
      server:
        git:
          uri: https://github.com/spring-cloud-samples/config-repo
          repos:
            simple: https://github.com/simple/config-repo
            special:
              pattern: special*/dev*,*special*/dev*
              uri: https://github.com/special/config-repo
            local:
              pattern: local*
              uri: file:/home/configsvc/config-repo

猜你喜欢

转载自javakill.iteye.com/blog/2386240