首页 文章

一个服务的所有配置文件的公共属性:spring cloud config

提问于
浏览
0

我想在一个服务的所有配置文件中设置公共属性 . 怎么做?现在我有以下结构

application.properies
service1
   profile1
       service1.properties
   profile2
       service1.properties
service2
   profile1
       service2.properties
   profile2
       service2.properties

如何共享 service1 的所有配置文件的公共属性?

1 回答

  • 0

    您可以在 bootstrap.ymlbootstrap.properties 文件中定义这些属性:

    application:
        name: "service1"
    
    cloud:
        config:
          uri: "http://<hostname>:<port>"
    
    # ... more common properties
    

相关问题