Using the spring framework, the program needs to call a function when it is started from the mysql query data, and then initializes to the redis, this function is to use the @ PostConstruct annotations;
Problem now is that started, database service is not ready, lead to the failure to connect to the database; Web service startup anomaly,
Want to ask next, connect to the database failed, if he can always try again, and again after the connection is successful startup,
CodePudding user response:
No actual configuration like this; Using SpringBoot framework, when Redis configuration using the @ AutoConfigureAfter (data source related add-in) annotations, specify the Redis in data loading before loading should be able to solve this problem, a detailed configuration need you find on the InternetCodePudding user response:
To implement the monitoring ApplicationListener