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.

XINFO CONSUMERS

Last updated
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.

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.
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 key when the stream does not exist, and WRONGTYPE.
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> XINFO CONSUMERS tasks workers
1) 1) "name"
2) "alice"
3) "pending"
4) (integer) 1
5) "idle"
6) (integer) 2310
7) "inactive"
8) (integer) 2310

A consumer that was made but has not read or claimed anything reports inactive as -1:

127.0.0.1:6379> XGROUP CREATE tasks reviewers 0
OK
127.0.0.1:6379> XGROUP CREATECONSUMER tasks reviewers bob
(integer) 1
127.0.0.1:6379> XINFO CONSUMERS tasks reviewers
1) 1) "name"
2) "bob"
3) "pending"
4) (integer) 0
5) "idle"
6) (integer) 41
7) "inactive"
8) (integer) -1

The idle times depend on when you run the command.

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.

XINFO, XINFO GROUPS, XGROUP DELCONSUMER, XPENDING