Search code examples
springspring-bootspring-cloud-config

Spring cloud config server fetching properties from native location is not working


Hi Please see the project structure of my config file Configuration server project structure

Include these lines in the yml file

   spring.profiles.active=native
spring.cloud.config.server.native.searchlocations =classpath:config/{application}

Here I can able to fetch properties directly under service name ,but don't know how to fetch data from folders like australia,canada .Please help


Solution

  • I solved this issue by providing another search location path in the server . see the below changes

    spring.cloud.config.server.native.searchlocations =classpath:config/{application},classpath:config/{application}/{label}
    

    And from the client side I have to make sure that I am passing correct label.

    spring.cloud.config.label=australia