0
0
Redisquery~10 mins

XREADGROUP for consumer groups 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 read messages from a Redis stream using XREADGROUP.

Redis
XREADGROUP GROUP mygroup consumer1 COUNT [1] STREAMS mystream >
Drag options to blanks, or click blank then click option'
A10
B5
C0
D1
Attempts:
3 left
💡 Hint
Common Mistakes
Using 0 for COUNT returns no messages.
Omitting COUNT may return too many messages.
2fill in blank
medium

Complete the code to specify the consumer group name in XREADGROUP.

Redis
XREADGROUP GROUP [1] consumer1 COUNT 5 STREAMS mystream >
Drag options to blanks, or click blank then click option'
Agroup1
Bconsumer1
Cmygroup
Ddefault
Attempts:
3 left
💡 Hint
Common Mistakes
Using the consumer name instead of the group name.
Using a group name that does not exist.
3fill in blank
hard

Fix the error in the XREADGROUP command to read pending messages for a consumer.

Redis
XREADGROUP GROUP mygroup [1] COUNT 5 STREAMS mystream 0
Drag options to blanks, or click blank then click option'
A0
Bconsumer1
Cmygroup
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using the group name twice.
Using '>' instead of '0' to read pending messages.
4fill in blank
hard

Fill both blanks to read new messages for a consumer group from a stream.

Redis
XREADGROUP GROUP [1] [2] COUNT 10 STREAMS mystream >
Drag options to blanks, or click blank then click option'
Amygroup
Bconsumer1
Cgroup1
Dconsumer2
Attempts:
3 left
💡 Hint
Common Mistakes
Swapping group and consumer names.
Using wrong group or consumer names.
5fill in blank
hard

Fill all three blanks to read pending messages for a specific consumer in a group.

Redis
XREADGROUP GROUP [1] [2] COUNT 5 STREAMS mystream [3]
Drag options to blanks, or click blank then click option'
Amygroup
Bconsumer2
C0
D>
Attempts:
3 left
💡 Hint
Common Mistakes
Using '>' instead of '0' to read pending messages.
Using wrong consumer or group names.