We have different configuration servers for each environment. Each spring boot application must configure a target configuration server. I tried to achieve this by setting profiles in the bootstrap.properties file, for example:
spring.application.name=app-name spring.cloud.config.uri=http://default-config-server.com --- spring.profiles=dev spring.cloud.config.uri=http://dev-config-server.com --- spring.profiles=stage spring.cloud.config.uri=http://stage-config-server.com --- spring.profiles=prod spring.cloud.config.uri=http://prod-config-server.com
And then I set cla -Dspring.profiles.active=dev , but the loaded configuration server is always the last one installed in the file (i.e. the prod settings server will be loaded into the above settings, and then if prod is deleted, the stage will be loaded )
Is it possible to set bootstrap settings for a cloud server? I followed this example , but didn't seem to be able to get it to work. For what it's worth, these profiles work just fine to load the correct configuration (for example, app-name-dev.properties will load if the dev profile is active), but not retrieved from the corresponding configuration server.
java spring-boot spring-profiles spring-cloud-config
dev_feed
source share