To setup Spring Cloud Bus which will use RabbitMQ (this is a publish/subscribe setup), as each of the microservices will subscribe to the RabbitMQ queue in order to get the latest property file versions. We start by adding a few new dependencies to the config server application, the spring boot actuator basically monitors and manages an application while its running. Each microservice will also need to pull in just the spring-cloud-starter-bus-amqp dependency.
You basically perform a HTTP POST request using the URI /bus-refresh which will pull the property files from GIT (or from secure file system), once the updated property files are puilled then they are pushed to all the microservices application that have registered.
To enable the /bus-refresh end point we add the below propertty to the config server property file.
Downlad and install RabbitMQ, I have already have a tutorial on RabbitMQ, so I am not going to cover it here. The add the below properties to the config server and all the microservice applications, change you reflect where your RabbitMQ server is installed, you can create a new user with a bit more complex password in RabbitMQ to use.
To update (push) any changes to the property files of the applications we are using we send a POST request to the config server http://localhost:8012/actuator/bus-refresh, the changes are broadcast to all the microservice applications (those that have configured/registered)
The actuator also offers other features like getting the health, beans, routes, etc of an application, first you need to add some properties to the proerty file
The update any web security you have
Then you can use something like postman to retrieve any information regarding the microservice application, JSON is returned on what information you required. This could be hooked into a monitoring system that will monitopr your microservices application.