XGROUP DELCONSUMER

Since 1.1.0Streams

Syntax

XGROUP DELCONSUMER key group consumer

Deletes 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; 0 if it had none or did not exist.

Errors

  • NOGROUP if the group does not exist.
  • ERR no such key if the key does not exist. Redis answers ERR The XGROUP subcommand requires the key to exist instead.

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.