最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

How to read specific config file from Spring Cloud Config? - Stack Overflow

programmeradmin2浏览0评论

first, i'm sorry my english is not good

for example, i have 4 config file in repository application1-profile1.yml application1-profile2.yml application2-profile1.yml application2-profile2.yml

and my client server read config file from Spring Cloud Config Server from this bootstrap.yml

spring:
  config:
    activate:
      on-profile: local 
  cloud:
    config:
      uri: http://localhost:2990
      name: application1,application2
      profile: profile1,profile2

then i can read 4 config file

but i want to read just 2 file application1-profile1.yml and application2-profile2.yml

is this posible to set the name and profile profile properties mapped to each other? not just put into array?

i know it can be work like

spring:
  config:
    activate:
      on-profile: local 
  cloud:
    config:
      uri: http://localhost:2990
      name: application1-profile1, application2-profile2

but there may be a lot of configuration files can be create, and since they are not for my use but for other people, I want to standardize the classification and loading of configuration files.

发布评论

评论列表(0)

  1. 暂无评论