Hi Spring Cloud Team,
Last week I had a short but nice chat with Oliver Gierke on the microXchg in Berlin about Spring Cloud. Looking on the architecture, all components can work in a parallel fashion to offer high availability. With a remote configuration source like git, it is even possible to run multiple synchronized config servers. But having a look on the documentation, it is only possible to pass one spring-cloud-config-uri. In my eyes this is a bottle neck, as the only one defined server could crash and a application can't load any properties even if a second config server is running. Managing the replication with Eureka is mentioned in the documentation, but not an option in every project.
What about the possibility to define multiple _spring-cloud-config-uri_s separated by comma?
Thanks for the nice project, Christoph.
Comment From: dsyer
Sounds like a reasonable suggestion, so pull requests welcome. But not particularly urgent IMO because you will commonly use the config server in an environment where there is a front end load balancer anyway, so a single URL is already highly available.
Comment From: indraneelb1903
Sorry for re-opening a old thread. Was this enhancement ever added? If it wasnt, would it be reasonable to add this enhancement where we can give a list of urls.
Comment From: indraneelb1903
Maybe iterate over the list of comma-separated urls and then depending upon which is UP( this can be subjective), decide the url to fetch properties from. Also I was thinking maybe have the flexibility to specify configServer(url) specific username-password credentials.
Comment From: indraneelb1903
So for example if explicit credentials have been provided - spring.cloud.config.username and spring.cloud.config.password. Then it does not matter which url we try to fetch our properties from and if any embedded credentials are present in the url, the one mentioned explicily will take precedence. But, if there are not mentioned explicitly, and are only present in the url. Then we can have per configServer username-password credentials.
For example-
spring:
cloud:
config:
uri: http://user:pass@localhost:8888, http://user1:pass1@localhost:8889
username: abcd
password: abcd1
Here abcd will be applied as username and abcd1 will be applied as password, regardless of which url is chosen to fetch properties from.
spring:
cloud:
config:
uri: http://user:pass@localhost:8888, http://user1:pass1@localhost:8889
If explicit credentials are not present, then apply what is embedded in the url.
Comment From: ryanjbaxter
Please learn how to format code on GitHub.
It has not been added
Comment From: indraneelb1903
My apologies. I have updated my comment. Should I create a new issue, highlighting this potential enhancement?
Comment From: spencergibb
This issue is still open, no need to open another.
Comment From: indraneelb1903
Does the above seem like a reasonable suggestion?
Comment From: ryanjbaxter
Seems fine to me
Comment From: indraneelb1903
If Config Server urls are located using Service Discovery like eureka and multiple urls are found, should it consider each one of them? I see right now, we are considering only the first one. Will submit a pull request soon.
Comment From: ryanjbaxter
Yes, each one
Comment From: indraneelb1903
Any additions required in the documentation, referencing this enhancement?
Comment From: ryanjbaxter
yes we will need documentation, good point
Comment From: indraneelb1903
Are u guys planning to add docs or should I have a stab at it in the same pull request? If u guys are close to a release, and want to squeeze this enhancement in it, go ahead, if not, i can try adding it myself, only issue being , i have not added documentation before to any open source project, so could take some time going back and forth.
Comment From: ryanjbaxter
Go ahead and add the documentation to https://github.com/spring-cloud/spring-cloud-config/blob/master/docs/src/main/asciidoc/spring-cloud-config.adoc
Comment From: paloorazeez
How to use spring config server registered with discovery server? Ideally instead of hard coding the hostname and port I need to use microservice name. Is this possible?
Comment From: ryanjbaxter
@paloorazeez https://docs.spring.io/spring-cloud-config/docs/current/reference/html/#discovery-first-bootstrap