spring-cloud / spring-cloud-config

External configuration (server and client) for Spring Cloud
Apache License 2.0
1.96k stars 1.29k forks source link

Share property from Config Server with all clients #554

Open andrewkandzuba opened 7 years ago

andrewkandzuba commented 7 years ago

Hello,

After a several days of documentation studding I'd stuck with a following issue. In my dev environment I have Spring Cloud Config Server running inside Docker container. At bootstrap I populates several properties via -D.. argument as this one -Dspring.rabbitmq.host=192.168.99.100. The actual value is known only at config server side.

When I connect to the server from a client I don't see these values among clients global properties. As far as I understood from the documentation the only option is to add a global application.yml file to a shared file system of git repo.

But it doesn't solve an issue as only constant values are being shared then however I must share a value known only at config server side and it is not invariant.

Are there any way to address the issue w/o writing custom code?

spencergibb commented 7 years ago

Does property overrides solve your problem? https://github.com/spring-cloud/spring-cloud-config/blob/master/docs/src/main/asciidoc/spring-cloud-config.adoc#property-overrides

andrewkandzuba commented 7 years ago

It needs to be tested as I'm going to share specific properties ONLY when apps bootstrap in Docker. However the target platform is Cloud Foundry and there spring.rabbitmq.host is defined via user services. I'll try and let you know.