也可以通过xautoclaim来实现。
6、一些监控命令 1、查看消费组中消费者的pending消息 127.0.0.1:6379> xpending stream-key g1 - + 10 c2 1) 1) "1636362623191-0" 2) "c2" 3) (integer) 1247680 4) (integer) 8 127.0.0.1:6379> 2、查看消费组中的消费者信息 127.0.0.1:6379> xinfo consumers stream-key g1 1) 1) "name" 2) "c1" 3) "pending" 4) (integer) 1 5) "idle" 6) (integer) 1474864 2) 1) "name" 2) "c2" 3) "pending" 4) (integer) 1 5) "idle" 6) (integer) 1290069 127.0.0.1:6379> 3、查看消费组信息 127.0.0.1:6379> xinfo groups stream-key 1) 1) "name" 2) "g1" 3) "consumers" 4) (integer) 2 5) "pending" 6) (integer) 2 7) "last-delivered-id" 8) "1636362623191-0" 2) 1) "name" 2) "g2" 3) "consumers" ...... 4、查看Stream信息 127.0.0.1:6379> xinfo stream stream-key 1) "length" 2) (integer) 2 3) "radix-tree-keys" 4) (integer) 1 5) "radix-tree-nodes" 6) (integer) 2 7) "last-generated-id" 8) "1636362623191-0" 9) "groups" 10) (integer) 4 11) "first-entry" 12) 1) "1636362619125-0" 2) 1) "aa" 2) "aa" 13) "last-entry" 14) 1) "1636362623191-0" 2) 1) "bb" 2) "bb" 127.0.0.1:6379> 五、参考文档1、https://redis.io/topics/streams-intro
2、https://www.runoob.com/redis/redis-stream.html