Introduction
Consumer groups help multiple clients share the work of reading messages from a stream without missing any messages or reading the same message twice.
XGROUP CREATE <stream> <groupname> <id or $> XREADGROUP GROUP <groupname> <consumername> COUNT <count> STREAMS <stream> > XACK <stream> <groupname> <id> [<id> ...]
XGROUP CREATE mystream mygroup $
XREADGROUP GROUP mygroup consumer1 COUNT 2 STREAMS mystream >XACK mystream mygroup 1526985058136-0
XADD mystream * name Alice XADD mystream * name Bob XGROUP CREATE mystream mygroup $ XREADGROUP GROUP mygroup consumer1 COUNT 2 STREAMS mystream > XACK mystream mygroup 1-0 2-0
mystream?XGROUP CREATE followed by stream name, group name, and ID.XGROUP CREATE mystream mygroup $ correctly creates group mygroup on mystream.mygroup on stream mystream, what does this command return?XREADGROUP GROUP mygroup consumer1 COUNT 2 STREAMS mystream >
consumer1.XREADGROUP GROUP mygroup consumer1 STREAMS mystream >
XREADGROUP GROUP mygroup consumer1 STREAMS mystream > uses '>' ID for new messages. COUNT is optional.XGROUP CREATE. If missing, it returns a NOGROUP error.orders and consumer group ordergroup. You want to ensure that if a consumer crashes before acknowledging messages, another consumer can claim and process those pending messages. Which Redis command helps you do this?XCLAIM lets another consumer take ownership of pending messages after a timeout.XCLAIM orders ordergroup consumer2 60000 1526985058136 claims message ID 1526985058136 for consumer2.Pass the test and this pattern moves unknown