Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Distributed Locks for Redis Template

I am trying to figure how distributed locks are used/implemented in Redis using Redis Template. I have race condition scenario so cant use Optimistic Locking with Multi and Exec.

I see RedisLockService implmentations which implements org.springframework.cloud.cluster.lock.LockService but that has been deprecated. Is there something new that has replaced it.

like image 327
user7180596 Avatar asked Mar 22 '26 00:03

user7180596


1 Answers

Why not use Redisson to implement a redis lock. there is a complete set of different distributed lock implementation in Redisson.

like image 112
Alan_Jin Avatar answered Mar 24 '26 22:03

Alan_Jin