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 CREATECONSUMER

Last updated
XGROUP CREATECONSUMER key group consumer
Group
Stream
Complexity
O(1)
Arity
5 (exactly, counting the command name)
HotKV Cloud
All plans
On-Premise
no license needed

XGROUP CREATECONSUMER adds consumer to the consumer group group on the stream at key. You rarely need it: XREADGROUP, XCLAIM and XAUTOCLAIM create the consumer on first use.

Case RESP2 RESP3
Consumer created Integer 1 Integer 1
Consumer already existed Integer 0 Integer 0

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> XGROUP CREATE orders billing $ MKSTREAM
OK
127.0.0.1:6379> XGROUP CREATECONSUMER orders billing worker-1
(integer) 1
127.0.0.1:6379> XGROUP CREATECONSUMER orders billing worker-1
(integer) 0

Same as Redis 7 and Valkey 8.

XGROUP DELCONSUMER, XINFO CONSUMERS, XGROUP