Reputation: 903
I am wondering if it is possible to configure the server ports for spring boot clients by getting them from the config server. I do realize that I can manually get the ports in each client code and configure the server's Connector class, but perhaps there is better way (something which can act as direct replacement of server.port in my application properties). In my project I have multiple clients running on a single host and I would like to manage all the ports from a central location (config server)
Upvotes: 1
Views: 299
Reputation: 25177
Certainly. In the eureka-bootstrap-config branch of spring-cloud-samples/hystrix-dashboard you can see there is no application.yml
. I get all its configuration from a cloned config-repo here. You can see the server.port
is in the remote repo. So you can absolutely do it.
Upvotes: 3