Quantcast
Channel: Active questions tagged redis+java - Stack Overflow
Viewing all articles
Browse latest Browse all 2203

Is it possible to store Objects in redis against Lock key while Acquiring redisson Distributed Locks

$
0
0

We are using redisson's distributed locks in order to avoid concurrency issue in our distributed environment but while acquiring the lock I also want to save some meta data like userId (random UUID) to know who acquired the lock, but the contingency is that I can't make the userId part of the key.

So please help me out if we can store some custom metadata with lock-key in redis distributed locks, or if there's any work around to get similar result.

 RLock lock = redisson.getFairLock("anyLock");//if we can store some custom data with the lock key.lock.lock();try {  ...} catch {  lock.unlock();}

Viewing all articles
Browse latest Browse all 2203

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>