现在我在我的应用程序中遇到了一个问题,如下所示:
Caused by: redis.clients.jedis.exceptions.JedisDataException: NOGROUP No such key 'pydolphin:stream:article' or consumer group 'pydolphin:stream:group:article' in XREADGROUP with GROUP option
at redis.clients.jedis.Protocol.processError(Protocol.java:135) ~[jedis-3.6.0.jar!/:?]
at redis.clients.jedis.Protocol.process(Protocol.java:169) ~[jedis-3.6.0.jar!/:?]
at redis.clients.jedis.Protocol.read(Protocol.java:223) ~[jedis-3.6.0.jar!/:?]
at redis.clients.jedis.Connection.readProtocolWithCheckingBroken(Connection.java:352) ~[jedis-3.6.0.jar!/:?]
at redis.clients.jedis.Connection.getBinaryMultiBulkReply(Connection.java:304) ~[jedis-3.6.0.jar!/:?]
at redis.clients.jedis.BinaryJedis.xreadGroup(BinaryJedis.java:4781) ~[jedis-3.6.0.jar!/:?]
at org.springframework.data.redis.connection.jedis.JedisStreamCommands.lambda$xReadGroup$17(JedisStreamCommands.java:364) ~[spring-data-redis-2.5.0.jar!/:2.5.0]
at org.springframework.data.redis.connection.jedis.JedisConnection.lambda$doInvoke$2(JedisConnection.java:176) ~[spring-data-redis-2.5.0.jar!/:2.5.0]
at org.springframework.data.redis.connection.jedis.JedisConnection.doWithJedis(JedisConnection.java:799) ~[spring-data-redis-2.5.0.jar!/:2.5.0]
... 17 more
现在我想看看redis中有多少组,令我惊讶的是,在阅读xgroup文档后我找不到任何命令来执行此操作。是否可以列出 redis 6.0+ 中的所有组?
XINFO GROUPS命令返回为给定流注册的所有组的数组。自 5.0 中引入流以来,它一直可用。
对于每个组,它还提供了当前组消费者的数量、已读取但尚未确认的条目数,以及该组的任何消费者看到的最新 ID。