0
0
Redisquery~10 mins

Consumer groups concept in Redis - Interactive Code Practice

Choose your learning style9 modes available
Practice - 5 Tasks
Answer the questions below
1fill in blank
easy

Complete the code to create a consumer group named 'mygroup' for the stream 'mystream'.

Redis
XGROUP CREATE mystream [1] $ MKSTREAM
Drag options to blanks, or click blank then click option'
Agroup1
Bmygroup
Cstreamgroup
DconsumerA
Attempts:
3 left
💡 Hint
Common Mistakes
Using a consumer name instead of a group name.
Confusing the stream name with the group name.
2fill in blank
medium

Complete the code to read messages from the stream 'mystream' using consumer group 'mygroup' and consumer 'consumer1'.

Redis
XREADGROUP GROUP mygroup [1] COUNT 10 STREAMS mystream >
Drag options to blanks, or click blank then click option'
AconsumerA
Bgroup1
Cconsumer1
Dmystream
Attempts:
3 left
💡 Hint
Common Mistakes
Using the group name instead of the consumer name.
Using the stream name instead of the consumer name.
3fill in blank
hard

Fix the error in the command to acknowledge a message with ID '1526985058136-0' in group 'mygroup' on stream 'mystream'.

Redis
XACK mystream mygroup [1]
Drag options to blanks, or click blank then click option'
A1526985058136-0
Bconsumer1
Cmystream
Dmygroup
Attempts:
3 left
💡 Hint
Common Mistakes
Using the consumer or group name instead of the message ID.
Using the stream name as the message ID.
4fill in blank
hard

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.

Redis
XCLAIM mystream mygroup [1] 60000 [2]
Drag options to blanks, or click blank then click option'
Aconsumer2
B1526985058136-0
Cconsumer1
D1526985058137-0
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping consumer names or message IDs.
Using a wrong message ID that does not exist.
5fill in blank
hard

Fill all three blanks to get the list of consumers in group 'mygroup' for stream 'mystream' and count their pending messages.

Redis
XINFO CONSUMERS [1] [2] | awk '{{print $1, $[3]'
Drag options to blanks, or click blank then click option'
Amystream
Bmygroup
C7
D8
Attempts:
3 left
💡 Hint
Common Mistakes
Mixing up stream and group names.
Using the wrong field number in awk.