2016-03-22 10 views
1

Ich benutze Dateisystem Backend (spring.profiles.active = native), um Konfigurationsdateien zu laden.spring.cloud.config.server.native.search-locations funktioniert nicht mit Platzhaltern in Spring Cloud Config-Server

Was ich erreichen möchte, ist separate Ordner pro Anwendung, wo alle Konfiguration der entsprechenden Komponente gespeichert ist, z. /configs/TestApp1/*.yml, /configs/TestApp2/*.yml

Dokumentation erzählt, dass dieser Platzhalter verwenden getan werden kann {Anwendung} in Suche Lokationen Eigenschaft (nach Frühling Cloud-Config Server-Dokumentation http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_spring_cloud_config_server). Dies ist jedoch nicht der Fall.

Ich habe folgende config in application.yml von Konfigurationsserver

 
server: 
    port: 8000 

spring: 
    cloud: 
    config: 
     server: 
     native: 
      search-locations: classpath:/configs/{application} 

profiles: 
    active: native 

Wenn ich HTTP-GET-Anfrage mache zum Endpunkt: http://localhost:8000/TestApp1/dev ich nicht bekommen Konfiguration von der Serverkonfiguration, wie es nicht Platzhalter-Client ersetzen Anwendungsname (zumindest glaube ich es auf diese Weise funktionieren soll) und versucht, in den folgenden Verzeichnissen zu suchen:

 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.xml' resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.xml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1.xml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.yml' resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.yml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1.yml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.properties' resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.properties' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1.properties' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.yaml' resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1-dev.yaml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/TestApp1.yaml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.xml' resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.xml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application.xml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.yml' resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.yml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application.yml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.properties' resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.properties' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application.properties' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.yaml' resource not found 
Skipped config file 'classpath:/configs/{application}/application-dev.yaml' for profile dev resource not found 
Skipped config file 'classpath:/configs/{application}/application.yaml' for profile dev resource not found 

Hinweis: ich zu debuggen Frühling Quelle versuchte s aber es scheint, dass Platzhalter nicht in Such-Standorte Eigentum ersetzt werden. Nun, es gibt auch eine Chance, dass ich etwas verpasst haben könnte :)

Vielleicht könnte jemand beraten, wie kann ich separate Konfigurationsverzeichnis pro Anwendung in Spring Cloud Config Server haben?

+0

Welche Version verwenden Sie? – spencergibb

+0

Ich benutze Angel.SR4 (Feder-Cloud-Eltern - 1.0.3.RELEASE, Spring-Boot-Starter-Eltern - 1.2.6.RELEASE) –

+0

Ich habe einen schnellen Check mit Version Angel.SR6 (Feder-Wolke -parent - 1.0.4.RELEASE, Spring-Boot-Starter-Elternteil - 1.2.8.RELEASE) aber immer noch kein Glück, um es zum Laufen zu bringen. –

Antwort

0

Ich habe einen Test mit Meilenstein-Version von Spring Cloud Brixton.M5 und Platzhalter {Anwendung} in Such-Standorten funktioniert wie erwartet.