XGROUP CREATECONSUMER
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.
Return value
Section titled “Return value”| 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.WRONGTYPEif the key holds another type.
Examples
Section titled “Examples”127.0.0.1:6379> XGROUP CREATE orders billing $ MKSTREAMOK127.0.0.1:6379> XGROUP CREATECONSUMER orders billing worker-1(integer) 1127.0.0.1:6379> XGROUP CREATECONSUMER orders billing worker-1(integer) 0Compatibility
Section titled “Compatibility”Same as Redis 7 and Valkey 8.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.