D. An error because the consumer group does not exist
Solution
Step 1: Analyze the commands and message ID
The group 'group1' is created on 'mystream'. A message is added with XADD, then read by consumer1. The XACK acknowledges message ID 1609459200000-0.
Step 2: Confirm message ID existence and acknowledgment
XADD adds the message with the specified ID 1609459200000-0. The XREADGROUP delivers it to consumer1's pending entries. XACK then acknowledges it and returns 1, the count of acknowledged messages.
Final Answer:
1 -> Option A
Quick Check:
XACK returns count of acknowledged messages = 1 [OK]
Hint: XACK returns number of messages acknowledged [OK]
Common Mistakes:
Assuming XACK returns message content
Thinking XACK errors if message ID is valid
Confusing XACK with XREADGROUP output
4. You run the command XACK mystream group1 1609459200000-0 but get an error: (error) NOGROUP No such consumer group 'group1' for stream 'mystream'. What is the most likely cause?
medium
A. The stream 'mystream' does not exist
B. The message ID is invalid
C. The XACK command syntax is incorrect
D. The consumer group 'group1' was not created on 'mystream'
Solution
Step 1: Interpret the error message
The error says no such consumer group 'group1' for stream 'mystream', meaning the group does not exist on that stream.
Step 2: Identify the cause
Either the group was never created or was created on a different stream. The stream existing or message ID validity does not cause this error.
Final Answer:
The consumer group 'group1' was not created on 'mystream' -> Option D
Quick Check:
Error NOGROUP means missing consumer group [OK]
Hint: NOGROUP error means consumer group missing on stream [OK]
Common Mistakes:
Assuming stream absence causes NOGROUP error
Blaming message ID format
Misreading error as syntax issue
5. You have a Redis stream orders with a consumer group processors. You want to acknowledge multiple messages with IDs 1609459200000-0, 1609459200001-0, and 1609459200002-0 in one command. Which command correctly does this?
hard
A. XACK orders processors 1609459200000-0 1609459200001-0 1609459200002-0
B. XACK orders processors [1609459200000-0, 1609459200001-0, 1609459200002-0]
C. XACK orders processors "1609459200000-0 1609459200001-0 1609459200002-0"
D. XACK orders processors {1609459200000-0,1609459200001-0,1609459200002-0}
Solution
Step 1: Recall XACK syntax for multiple IDs
XACK accepts multiple message IDs separated by spaces without brackets or quotes.
Step 2: Evaluate options
XACK orders processors 1609459200000-0 1609459200001-0 1609459200002-0 lists IDs separated by spaces correctly. Options B, C, and D use brackets, quotes, or braces which are invalid syntax.
Final Answer:
XACK orders processors 1609459200000-0 1609459200001-0 1609459200002-0 -> Option A
Quick Check:
Multiple IDs in XACK = space-separated list [OK]
Hint: List multiple IDs space-separated in XACK command [OK]
Common Mistakes:
Using brackets or quotes around IDs
Separating IDs with commas
Passing IDs as a single string
Recommended
Ready to prove it?
Pass the test and this pattern moves unknownstrongwhile earning +1 Grip toward your certificate.