0

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.

PasanNadeera
  • 101
  • 1
  • 9

2 Answers2

1

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

  • correction: the message_id in a PEL is NOT removed even when the message is deleted from the stream. Check this issue: https://github.com/redis/go-redis/issues/2514 – 0xh8h Apr 02 '23 at 15:00
0

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.

Mikel
  • 1