I would like to know how to clear the PEL list for a given Redis consumer group without individually acknowledging every message.
Context
I have a consumer group for my one of my Redis streams. For testing purposes, I need to clear the PEL list of the consumer group without deleting the stream.
2
Answers
From a consumer view, you can use XPENDING to know which are the message-ids list that are not yet acknowledged. Then using XCLAIM you can claim a specific message.
There is also XAUTOCLAIM command, which composes XPENDING and XCLAIM for every message in the group.
Anyway by design the message is in a PEL and it’s removed only when it’s acknowledged, claimed by another consumer or deleted from the stream.
XPENDING
XCLAIM
XAUTOCLAIM
Redis doesn’t implement any command to do that functionality. Only way to remove entries from the PEL of a consumer is to ACK each pending message individually.
This thread explains why deleted messages from a stream still are part of a PEL.