Use @RefreshScope to refresh the configuration without restarting the program

This solution needs to be verified using external configuration. The startup command is as follows: java -jar xxx.war –spring.profiles.active=local –spring.config.location=E:\ideaFile Use @RefreshScope 1. Import dependencies Add the following dependencies: <!–refresh configuration–> <dependency> <groupId>org.springframework.cloud</groupId> <artifactId>spring-cloud-starter-config</artifactId> </dependency> <!–Monitor–> <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-actuator</artifactId> </dependency> 2. Add corresponding configuration Set the open refresh interface. For example, add the following configuration […]

Go deep into the SocketIO source code to solve the problem of SocketIOServer restart failure

Foreword When we develop the SocketIO server, we often need to use the information of the clients that have established connections. For example, when triggering data to be sent to certain clients, we must be able to obtain the corresponding client objects. Therefore, we need to combine a group of The corresponding relationship between the […]

K8s pod restart strategy and health check realize automatic application repair

1. Restart strategy Always: When the container terminates and exits, always restart the container, the default policy. OnFailure: Restart the container only when the container exits abnormally (exit status code is non-0). Never: Exit when the container terminates and never restart the container. 2. Health check has the following two types: livenessProbe (liveness check): If […]

PYTHON-“Life Restart Simulator”

write in front Hello everyone, my name is Aileen. I hope it will be helpful to you after reading it. Please correct me if I have any shortcomings! Learn and communicate together This article was originally published by Aileen_0v0 on CSDN Please notify us if you need to reprint it? Personal homepage: Aileen_0v0-CSDN blog Welcome […]

MongoDB fails to start after server restart

Article directory MongoDB fails to start after server restart background planning implement Summarize MongoDB cannot be started after restarting the server Background The CPU of the database server is close to the alarm value, and CPU resources need to be added, so the server is shut down at an appropriate time, and the server is […]