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

Instance safe HashSet of BlockingQueue

$
0
0

I need a data structure like HashSet<Obj, BlockingQueue<Obj> > ds which should be thread safe and instance safe. I can use redisTemplate to store this data structure as redis is thread safe but the problem is when i run multiple instances of my application, the BlockingQueue is not returning different object for concurrent thread in all instances all time. When i call take() after getting the queue using key from redis, sometimes some instance getting same object. I need different object in all instances. I can use Set rather then Queue as Set will return object randomly. But still there is a chance to get same object in different instance. Any suggestion will be highly appreciable.


Viewing all articles
Browse latest Browse all 2203

Trending Articles



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