XGROUP DELCONSUMER
Since 1.1.0Streams
Syntax
XGROUP DELCONSUMER key group consumerDeletes the consumer consumer from the consumer group group, with its pending entries. Those entries are then pending for no one: XPENDING no longer lists them, and a read with > does not deliver them again, since the group has moved past them. To keep that work, move it to another consumer first with XCLAIM or XAUTOCLAIM, then delete the consumer.
Use it to remove consumers that are gone for good, such as workers of a scaled-down deployment, so that they stop showing in XINFO CONSUMERS.
Reply
- The number of entries that were pending for the consumer;
0if it had none or did not exist.
Errors
NOGROUPif the group does not exist.ERR no such keyif the key does not exist. Redis answersERR The XGROUP subcommand requires the key to existinstead.
Examples
> XPENDING jobs workers
1) (integer) 2
2) "2-0"
3) "3-0"
4) 1) 1) "bob"
2) "1"
2) 1) "alice"
2) "1"
> XGROUP DELCONSUMER jobs workers alice
(integer) 1
> XPENDING jobs workers
1) (integer) 1
2) "3-0"
3) "3-0"
4) 1) 1) "bob"
2) "1"
> XGROUP DELCONSUMER jobs workers nobody
(integer) 0
The consumers in the XPENDING summary come in no fixed order.