Some Thoughts on the use of configuration files

In the project development process, throughout the profile, development time debugging, modification time line, hoping to be dynamic, real-time.

Recently reconstructed a few years ago the old project, is relatively small, there is a cluster of two lines, which must also have a problem profile line changes.
PS: the company's other new departments are used ctripcorp / Apollo , our technical team are older, leader did not want to introduce, we can only themselves.

Before this project was war package, you need an external tomcat, now turned into a springboot, labeled jar package, easy to configure jenkins (tomcat heard too much trouble, is not clear). This presents a problem, if the package is war, modify the configuration file directly through the interface call to re-locate the configuration file, then refresh enough. The jar package, you change the configuration file within a jar, can not refresh configuration to memory, test a lot of ways, find a lot of tutorials, spring cloud package pull local configuration dynamically refreshed I did not test successful, probably technology is not place.

The final solution is, when the project started, copy the jar inside the configuration file to the same directory maintenance, after modifying the configuration by calling the interface, reads an external file to refresh memory. Cry ing.

Era of progress, really should absorb a good solution, they should slowly accept the configuration center, although for this system, set up a distribution center is not quite worth it, but the longer term, or long pain as short-term pain, after all, the project there are 10 groups in several projects in maintenance, it can be used. Not in that position, would likely really not the same.

Reproduced in: https: //www.jianshu.com/p/6987a4adf6c6

Guess you like

Origin blog.csdn.net/weixin_34261739/article/details/91258742