Redisson Queue returns same object for multiple polls in an distributed service setup

12/19/2020

since I couldn't find anything explicitly explaining how to use an RQueue in an actual distributed setup that differs from the default single instance examples, I hope someone here can explain my mistake.

I have a multiple microservices instances that all utilize Redisson with the same Redis connection in order to retrieve elements from an RQueue. It's a single connection via port-forwarding to a Kubernetes service backed by a 3-node Redis Sentinel Cluster (Redis 6.0.9 deployed via Helm chart). If each service executes a single poll() on the RQueue and they all receive the same object.

redissonClient.<Job>getQueue(queueKey).poll();

In my understanding this should not happen and another service instance should never be able to poll a previously polled element, too.

The queue only works as expected when I execute polls from the same service instance. Is this maybe just a configuration issue I'm not aware of?

If this question does not provide enough information or context, I will gladly enhance it accordingly!

And thanks in advance for any help!

-- godsim
java
kubernetes
queue
redis
redisson

0 Answers