I am trying to configure environment based configuration using Spring cloud config server hosted on Github. Below is my repository structure
│ application.properties │ README.MD ├───damech-authenticator │ damech-authenticator-dev.properties │ damech-authenticator-prod.properties │ damech-authenticator-qa.properties │ damech-authenticator.properties │
├───damech-customer │ damech-customer-dev.properties │ damech-customer-prod.properties │ damech-customer-qa.properties │ damech-customer.properties │ ├───damech-login │ damech-login-dev.properties │ damech-login-prod.properties │ damech-login-qa.properties │ damech-login.properties │ └───damech-serviceprovider damech-serviceprovider-dev.properties damech-serviceprovider-prod.properties damech-serviceprovider-qa.properties damech-serviceprovider.properties
As mentioned in "https://cloud.spring.io/spring-cloud-config/multi/multi__spring_cloud_config_server.html#_placeholders_in_git_search_paths" I also configured searchPaths as below in my application.properties :-
server.port=9192
spring.cloud.config.server.git.uri=https://github.com/DaMech-LLP/DaMech-cloud-config-repo
spring.cloud.config.server.git.username=xxxxxxxx
spring.cloud.config.server.git.password=xxxxxxxxx
spring.cloud.config.server.git.searchPaths=damech-areamanager, damech-login, damech-customer, damech-serviceprovider, damech-authenticator
Application is getting started without any issues but when I am trying to get dev properties using POSTMAN GET request ( http://localhost:9192/damech-areamanager/dev) it always returns me default application.properties as response instead of damech-areamanager-dev.properties
Please let me know if I am missing any configuration or my spring.cloud.config.server.git.searchPaths property has wrong value.
Comment From: vidhangithub
It's resolved now with this placeholder in application.properties spring.cloud.config.server.git.searchPaths=damech* and you must have some placeholders set in properties file otherwise it will always return default response.