XINFO CONSUMERS
XINFO CONSUMERS key group
- Group
- Stream
- Complexity
- O(1) per consumer
- Arity
- 4 (exactly, counting the command name)
- HotKV Cloud
- All plans
- On-Premise
- no license needed
XINFO CONSUMERS returns one record per consumer of the group group on the
stream at key, ordered by consumer name.
Fields
Section titled “Fields”| Field | Meaning |
|---|---|
name |
The consumer’s name. |
pending |
Entries the consumer holds that are not yet acknowledged. |
idle |
Milliseconds since the consumer last read, claimed or was created. |
inactive |
Milliseconds since the consumer last received entries from XREADGROUP or claimed some with XCLAIM or XAUTOCLAIM. -1 for a consumer that never has, for example one made with XGROUP CREATECONSUMER that has not read. |
Return value
Section titled “Return value”| Case | RESP2 | RESP3 |
|---|---|---|
| Group exists | Array with one flat array of field names and values per consumer | Array of maps |
Error replies:
NOGROUP No such consumer group 'group' for key name 'key'ERR no such keywhen the stream does not exist, andWRONGTYPE.
Examples
Section titled “Examples”127.0.0.1:6379> XADD tasks 1700000000000-0 job email"1700000000000-0"127.0.0.1:6379> XGROUP CREATE tasks workers 0OK127.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> XINFO CONSUMERS tasks workers1) 1) "name" 2) "alice" 3) "pending" 4) (integer) 1 5) "idle" 6) (integer) 2310 7) "inactive" 8) (integer) 2310A consumer that was made but has not read or claimed anything reports
inactive as -1:
127.0.0.1:6379> XGROUP CREATE tasks reviewers 0OK127.0.0.1:6379> XGROUP CREATECONSUMER tasks reviewers bob(integer) 1127.0.0.1:6379> XINFO CONSUMERS tasks reviewers1) 1) "name" 2) "bob" 3) "pending" 4) (integer) 0 5) "idle" 6) (integer) 41 7) "inactive" 8) (integer) -1The idle times depend on when you run the command.
Compatibility
Section titled “Compatibility”Same fields as Redis 7.2 and Valkey 8. As in Redis, inactive counts from
the consumer’s last successful read and is -1 for a consumer that never read
anything.
See also
Section titled “See also”Was this page helpful?
Thanks for the feedback.