GH-3655: Add automatically delete for Redis Locks

Fixes https://github.com/spring-projects/spring-integration/issues/3655

* support automatically clean up cache
* RedisLockRegistry.capacity desc
This commit is contained in:
unseok kim
2021-11-08 09:13:37 -05:00
committed by Artem Bilan
parent 25100d1ac7
commit e51513230a
3 changed files with 217 additions and 11 deletions

View File

@@ -883,3 +883,6 @@ However, the resources protected by such a lock may have been compromised, so su
You should set the expiry at a large enough value to prevent this condition, but set it low enough that the lock can be recovered after a server failure in a reasonable amount of time.
Starting with version 5.0, the `RedisLockRegistry` implements `ExpirableLockRegistry`, which removes locks last acquired more than `age` ago and that are not currently locked.
String with version 5.5.6, the `RedisLockRegistry` is support automatically clean up cache for redisLocks in `RedisLockRegistry.locks` via `RedisLockRegistry.setCapacity()`.
See its JavaDocs for more information.