Some pits used by Spring Config configuration center and Spring Bus

1. Many articles do not mention @RefreshScope. If the injected fields are not refreshed after you refresh the configuration, you need this annotation on your class

2. Most of the articles say that as long as one node is configured, all microservice nodes can be refreshed through /bus/refresh of the node. I don’t know if I understand it incorrectly or write it unclearly. Anyway, if you want to refresh other nodes, Then this node must introduce mq configuration, it must be connected to the message center


https://github.com/suozq1/learning/tree/master/onsite This is the git address of my project, I hope it will help you

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325959820&siteId=291194637