Apollo is an open source configuration center developed by the Ctrip Framework Department. It can centrally manage the configuration of applications in different environments and different clusters, which greatly facilitates configuration file management under the microservice architecture. After configuration changes, it can be pushed to the application side in real time without restarting the application. , And has standardized authority management, gray release, process management, etc., which is very suitable for microservice configuration management scenarios.
Downloading, installing and running are very simple, almost out of the box.
(0) First add a new project
(1) After the startup is successful, click to add a new namespace:
(2)
(3)
(4) Add configuration information under the newly added namespace, remember to click Publish
(5) Remember to introduce the new namespace in the yml configuration file
(6) Writing a controller is like reading the configuration from the configuration file normally
(7) The test is successful
This shows that we can configure all middleware or databases or some constant information on Apollo, and the yml file can be more concise than ever. It will be more convenient to modify, and there is no need to restart the application.