Skip to content

Ask the HotKV docs

Answers come only from these docs and can be wrong; check the linked pages before you rely on them.

XGROUP DELCONSUMER

Last updated
XGROUP DELCONSUMER key group consumer
Group
Stream
Complexity
O(N), N being the consumer's pending entries
Arity
5 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

XGROUP DELCONSUMER removes consumer from the consumer group group and returns how many pending entries it held. Those entries leave the group’s pending list, so no other consumer can claim them afterwards. Claim them with XCLAIM or XAUTOCLAIM first if they still need processing.

Case RESP2 RESP3
Always Integer: the pending entries the consumer held (0 if it did not exist) Integer

Error replies:

  • NOGROUP No such consumer group 'group' for key name 'key'
  • ERR The XGROUP subcommand requires the key to exist. ... when the stream does not exist.
  • WRONGTYPE if the key holds another type.
127.0.0.1:6379> XADD tasks 1700000000000-0 job email
"1700000000000-0"
127.0.0.1:6379> XGROUP CREATE tasks workers 0
OK
127.0.0.1:6379> XREADGROUP GROUP workers alice STREAMS tasks >
1) 1) "tasks"
2) 1) 1) "1700000000000-0"
2) 1) "job"
2) "email"
127.0.0.1:6379> XGROUP DELCONSUMER tasks workers alice
(integer) 1
127.0.0.1:6379> XPENDING tasks workers
1) (integer) 0
2) (nil)
3) (nil)
4) (nil)

Same as Redis 7 and Valkey 8.

XGROUP CREATECONSUMER, XINFO CONSUMERS, XGROUP