My config folder is in "/src/main/resources/" path and it looks like this Config ---------ServiceAConfigs ---------------dbCOnfigForServiceA.properties ---------ServiceBConfigs ---------------dbCOnfigForServiceB.properties defaultConfig.properties
ServiceAConfigs,ServiceBConfigs are subfolders under config folder. I just want to isolate config files for each of my micro-services.
The current application.properties file of my config server looks like
server.port: 8888 spring.profiles.active=native spring.cloud.config.server.native.searchLocations=classpath:/config,classpath:/config/ServiceAConfigs,classpath:/config/ServiceBConfigs
MY question is how can I set "spring.cloud.config.server.native.searchLocations" key's value so that it scans all folders and sub folders under the config folder shown above. I tried classpath:/config/* but it did not work.
Thanks in advance!
Comment From: lowzj
You could add this property into your micro-service config file:
spring.cloud.config.label={The Sub-directory name}
The search locations can contain placeholders for {application}, {profile} and {label}. In this way you can segregate the directories in the path, and choose a strategy that makes sense for you (e.g. sub-directory per application, or sub-directory per profile).
More detail see: http://cloud.spring.io/spring-cloud-config/spring-cloud-config.html#_file_system_backend
Comment From: fy-kenny
classpath:/{application} but only one depth
Comment From: Ayushnita
How to handle more then one depth