我正在尋找實現12factor方法來通過Spring Cloud Config來外化配置,但我無法像預期的那樣獲得使用searchPaths的通配符。spring cloud config searchPaths
文檔http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_spring_cloud_config_server提到通配符{application},{label},{profile}可以在searchPaths變量中使用,因此「您可以分隔路徑中的目錄並選擇一種對您有意義的策略(例如,每個應用程序的子目錄或每個配置文件的子目錄)「
我正在尋找一個git倉庫,每個配置文件有子目錄(然後每個應用程序或每個應用程序的子目錄(然後通過簡檔)
例如
spring:
cloud:
config:
server:
git:
uri: https://stash.xxx.com.au/scm/xxx/config
searchPaths: {application}
or
searchPaths: {profile}
or
searchPaths: {application}/{profile}
但是,當我在我的searchPaths中使用任何通配符{application}或{profile}時,它在git repo中找不到數據,或者連接選項無法啓動。
有沒有人有我可以參考的工作示例? Cheers Roy
你沒有說你使用的是什麼版本的spring cloud config(這是最近的一個功能)。 –