Complete the code to create a consumer group named 'mygroup' for the stream 'mystream'.
XGROUP CREATE mystream [1] $ MKSTREAMThe XGROUP CREATE command creates a consumer group. The group name here is 'mygroup'.
Complete the code to read messages from the stream 'mystream' using consumer group 'mygroup' and consumer 'consumer1'.
XREADGROUP GROUP mygroup [1] COUNT 10 STREAMS mystream >
The XREADGROUP command requires the consumer name after the group name. Here, 'consumer1' is the consumer reading messages.
Fix the error in the command to acknowledge a message with ID '1526985058136-0' in group 'mygroup' on stream 'mystream'.
XACK mystream mygroup [1]The XACK command acknowledges a message by its ID. The message ID '1526985058136-0' must be provided.
Fill both blanks to claim pending messages for consumer 'consumer2' in group 'mygroup' on stream 'mystream' that have been idle for more than 60000 milliseconds.
XCLAIM mystream mygroup [1] 60000 [2]
The XCLAIM command requires the consumer name and the message ID to claim pending messages. Here, 'consumer2' claims the message '1526985058136-0'.
Fill all three blanks to get the list of consumers in group 'mygroup' for stream 'mystream' and count their pending messages.
XINFO CONSUMERS [1] [2] | awk '{{print $1, $[3]'
The XINFO CONSUMERS command lists consumers for a group. The stream is 'mystream', the group is 'mygroup'. The awk command prints the first and eighth fields, where the eighth field is the pending message count.