Closed
Description
spring boot v2.7.14
I found the following problem when using the spring-data-redis component to monitor the key expiration function of Redis. Here are the steps to reproduce my problem:
- Start Redis normally, and configure the properties of Redis.conf: notify-keyspace-events Ex
- Start spring boot
- Go to Redis to create a new key, and then set an expiration time of 3 seconds for this key
- After 3 seconds, my springboot log output this expired key
Everything is normal here, continue to operate. - Close the Redis service process, and the springboot log will print the log of Redis connection failure. After about 5 seconds, restart the Redis service process
- Repeat step 3. At this time, the springboot log shows that Redis is connected successfully, but I cannot receive the expired key. When I restart springboot, repeat step 3, and I can receive the expired key again.
To sum up, I suspect that the spring-data-redis component is not fully connected to Redis. After restarting Redis, the system cannot receive a new key with an expiration time.
My configuration is as follows:
Let me summarize again,
When spring-data-redis is connected normally, restarting the Redis process will result in failure to receive expired keys, but the Redis connection is normal (not sure if it is normal, see the log is normal)