I have a requirement to retrieve the property files with environment name distinguishing those.
Config server is listening to this repo (https://github.com/tpande1/spring-cloud-config-repo/tree/master) which has : config-client-dev.properties, config-client-sbx.properties, config-client-test.properties and config-client-prod.properties
In Client Server i have the below config to read from the above github repo. How can i read these different properties with the environment specified in my Client Application?
Sample Rest Code:
@GetMapping("/message") //Pick message(SBX, DEV, Test, PROD) from the propertyfile from github
public String getMessage() {
return message;
}
bootstrap.yml:
spring: profiles: dev application: name: config-client cloud: config: uri: http://localhost:1000 //Config server port profile: sbx, dev, test, prod
management.endpoints.web.exposure.include: "*"