I have a redis
database in my spring boot
application. I use Jedis
as my Redis
client for retrieval, update and delete.
Now I'm willing to add distributed locks to my service, so I thought about using Redisson
distributed locks. So my Redisson
lock will be used to acquire and release lock around some logic of Jedis
client.
Example:
redissonLock.acquire();
doSomeReadAndUpdateOperationsByJedis()
redissonLock.release();
Will using two redis
clients work here? And if not, what is the best way to use a distributed lock with Jedis
.