I am starting to learn Spring Cloud starting with Spring Config. There are two basic questions as I have to get me onto the next step in my learning process (moving on to Service Discovery via Consul).
/refresh
endpoint to POST to?For #1 I implemented my own @RestController
/@RequestMapping
but none of the tutorials I was following mentioned that. I checked my Maven configuration and it matches what the samples were providing but it's not popping up.
I found a post for the second question here: spring cloud auto refresh config server property. I was just wondering if there were any updates since November 2015 on this.
Both of these things seem to be exceedingly handy and will be directly intertwined with my Consul learning as I can push configuration updates automatically to everyone that is registered as a service. Once I get there I can work on the restarts too, but that is later.
I got an answer to #1. I had botched my dependencies configuration in my Maven module. After triple-checking the configuration it turns out it was just pilot error. Still working on #2, though - if anyone has any updates it would be appreciated.
For #1, Spring cloud config intrdouced the @RefreshScope
annotation which will expose the /refresh
endpoint (over HTTP or JMX)
For #2, after '/refresh', spring cloud config will take the latest git commit, For the config changes, essentially there are two ways, 1) pull the changes 2) push the changes, spring cloud bus approach is based on the rabbitmq to push the config chagnes.
Reference
Refresh Scope
For GIT updates try to go through this documentation spring-cloud-config-push-notifications and do not forget to install ngrock. Also if you just need to refresh on git commit then you do not even need cloud-bus project just config should be enough. Hope this helps.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With