Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Spring Cloud Config Server

I am using the Spring Cloud Config Server and able to detect the changes from the git repository and pass it to the Config clients.

There are two ways, I have implemented it:

  1. After making changes (commit and push) in the git repository, I make a curl request curl -X POST http://server:port/bus/refresh and it works fine. For this I am using RabbitMQ as the Spring Cloud Bus.

Reference: http://tech.asimio.net/2017/02/02/Refreshable-Configuration-using-Spring-Cloud-Config-Server-Spring-Cloud-Bus-RabbitMQ-and-Git.html

  1. After making changes (commit and push) in the git repository, I make a curl request curl -X POST http://server:port/refresh (with no /bus in the url) and it works fine. I am NOT using Spring Cloud Bus here.

Reference: https://spring.io/guides/gs/centralized-configuration/

So both works fine, so Is there any advantage of using Spring Cloud Bus, or in Production environment, will there be any issue with going without Spring Cloud Bus? As there will be extra effort needed to get setup the RabbitMQ Cluster (HA) as Spring Cloud Bus in production.

Thanks, David

like image 729
David Avatar asked Apr 11 '17 15:04

David


1 Answers

/refresh will only refresh the config client to whom the request was made. It only refreshes locally. Using /bus/refresh will refresh all clients connected to the bus. In other words it will refresh all bus clients (or a subset if the destination parameter is set).

like image 83
spencergibb Avatar answered Sep 25 '22 19:09

spencergibb