Our Current Design
Env Redis 2.8.17
We have implemented our reliable queue, using the pattern similar to the one described in redis documentation, under RPOPLPUSH
However, we are using BRPOPLPUSH considering its blocking nature, and LPUSH for ensuring the FIFO order.
Producers: multiple threads(from multiple servers) using LPUSH to push the items.
Consumers: multiple threads(from multiple servers) using BRPOPLPUSH to process the items.
BRPOPLPUSH q processing-q
As documented, redis pops the item from queue 'q', while adding them in 'processing-q'.
Problem
Owing to the multi-threaded(async) nature of our application, we don't have any control over, when the consumers will be completing their processing.
So, if we use LREM(as per documentation) to remove the processed element from processing-q, this will only remove the top element of the processing-q. Where as it has no guarantee, on whether it has removed the actual element, which was processed by the respective consumer.
So if we don't do anything the processing-q keeps on growing(eating-up memory), which is very bad IMHO.
Any suggestions or ideas ?