XINFO 消费者

Syntax
XINFO CONSUMERS key group
Available since:
5.0.0
Time complexity:
O(1)
ACL categories:
@read, @stream, @slow,

此命令返回属于存储在的流的消费者组的消费者列表。

为组中的每个消费者提供以下信息:

  • name: 消费者的名字
  • pending: PEL中的条目数:消费者的待处理消息,这些是已传递但尚未确认的消息
  • idle: 自消费者上次尝试交互以来经过的毫秒数(示例:XREADGROUP, XCLAIM, XAUTOCLAIM)
  • inactive: 自消费者上次成功交互以来经过的毫秒数(示例:XREADGROUP 实际读取了一些条目到 PEL 中,XCLAIM/XAUTOCLAIM 实际认领了一些条目)

请注意,在Redis 7.2.0之前,idle 用于表示自上次成功交互以来经过的时间。 在7.2.0版本中,添加了inactive,并将idle更改为表示自上次尝试交互以来经过的时间。

示例

> XINFO CONSUMERS mystream mygroup
1) 1) name
   2) "Alice"
   3) pending
   4) (integer) 1
   5) idle
   6) (integer) 9104628
   7) inactive
   8) (integer) 18104698
2) 1) name
   2) "Bob"
   3) pending
   4) (integer) 1
   5) idle
   6) (integer) 83841983
   7) inactive
   8) (integer) 993841998

RESP2/RESP3 回复

Array reply: a list of consumers and their attributes.

历史

  • 从 Redis 7.2.0 版本开始:添加了 inactive 字段,并更改了 idle 的含义。
RATE THIS PAGE
Back to top ↑