在我的流中,我有一个挂起的消息:
redis[7]> XREADGROUP GROUP symfony consumer COUNT 1 STREAMS messages 0
1) 1) "messages"
2) 1) 1) "1592850947048-0"
2) (nil)
redis[7]> XPENDING messages symfony
1) (integer) 1
2) "1592850947048-0"
3) "1592850947048-0"
4) 1) 1) "consumer"
2) "1"
不可能是(零),但还是。。我看到了新消息:
redis[7]> XREADGROUP GROUP symfony consumer COUNT 1 STREAMS messages >
1) 1) "messages"
2) 1) 1) "1593141769417-0"
2) 1) "message"
2) "s:726:\"{\"body\":\"O:36:\\\\\\\"Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Envelope\\\\\\\":2:{s:44:\\\\\\\"\\\\0Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Envelope\\\\0stamps\\\\\\\";a:1:{s:46:\\\\\\\"Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Stamp\\\\\\\\BusNameStamp\\\\\\\";a:1:{i:0;O:46:\\\\\\\"Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Stamp\\\\\\\\BusNameStamp\\\\\\\":1:{s:55:\\\\\\\"\\\\0Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Stamp\\\\\\\\BusNameStamp\\\\0busName\\\\\\\";s:21:\\\\\\\"messenger.bus.default\\\\\\\";}}}s:45:\\\\\\\"\\\\0Symfony\\\\\\\\Component\\\\\\\\Messenger\\\\\\\\Envelope\\\\0message\\\\\\\";O:26:\\\\\\\"App\\\\\\\\Bus\\\\\\\\Message\\\\\\\":2:{s:32:\\\\\\\"\\\\0App\\\\\\\\Bus\\\\\\\\Message\\\\0type\\\\\\\";i:6;s:35:\\\\\\\"\\\\0App\\\\\\\\Bus\\\\\\\\Message\\\\0payload\\\\\\\";a:1:{s:7:\\\\\\\"eventId\\\\\\\";i:83787;}}}\",\"headers\":[]}\";"
redis[7]> XPENDING messages symfony
1) (integer) 2
2) "1592850947048-0"
3) "1593141769417-0"
4) 1) 1) "consumer"
2) "2"
新消息不是空的,但是如果我读了消息-两者都是(nil)
redis[7]> XREADGROUP GROUP symfony consumer COUNT 2 STREAMS messages 0
1) 1) "messages"
2) 1) 1) "1592850947048-0"
2) (nil)
2) 1) "1593141769417-0"
2) (nil)
为什么?
1条答案
按热度按时间6qfn3psc1#
这是redis流的正常行为?redis delete old message body(设置为
nil
)即使收到一些消费者的信息。