Using Redis stream we can have pending items which aren't finished by some consumers. I can find such items using xpending command. Let we have two pending items:
1) 1) "1-0"
2) "local-dev"
3) (integer) 9599
4) (integer) 1
2) 1) "2-0"
2) "local-dev"
3) (integer) 9599
4) (integer) 1
The problem that by using xpending
we can set filters based on id only. I have a couple of service nodes (A
, B
) which make zombie check: XPENDING mystream test_group - 5 1
Each of them receives "1-0"
item and they make xclaim
and only one of them (for example A
) becomes the owner and starts processing this item. But B
runs xpending
again to get new items but it receives again "1-0"
because it hasn't been processed yet (A
is working) and it looks like all my queue is blocked.
Is there any solution how I can avoid it and process pending items concurrently?