Bird
0
0

Which approach best achieves this?

hard📝 Best Practice Q15 of 15
AWS - SNS and SQS
You have an SQS queue with a DLQ configured and maxReceiveCount set to 4. You want to ensure that messages that fail processing due to a temporary downstream service outage are retried multiple times before moving to the DLQ. Which approach best achieves this?
ASet maxReceiveCount to 4 and implement exponential backoff in the message consumer
BSet maxReceiveCount to 1 and rely on DLQ for retries
CRemove the DLQ and increase message visibility timeout
DSet maxReceiveCount to 10 and disable retries in the consumer
Step-by-Step Solution
Solution:
  1. Step 1: Understand retry and DLQ roles

    maxReceiveCount controls how many times a message is retried before DLQ. Exponential backoff helps avoid flooding retries.
  2. Step 2: Evaluate options for retry strategy

    Set maxReceiveCount to 4 and implement exponential backoff in the message consumer combines proper maxReceiveCount with backoff to handle temporary failures effectively.
  3. Step 3: Reject other options

    Removing the DLQ is counterproductive as it's needed for persistent failures. Setting maxReceiveCount to 1 limits retries too much. Setting maxReceiveCount to 10 and disabling retries in the consumer is not effective for temporary outages.
  4. Final Answer:

    Set maxReceiveCount to 4 and implement exponential backoff in the message consumer -> Option A
  5. Quick Check:

    Retries + backoff before DLQ = best practice [OK]
Quick Trick: Use maxReceiveCount with backoff for retries before DLQ [OK]
Common Mistakes:
  • Setting maxReceiveCount too low
  • Removing DLQ mistakenly
  • Disabling retries in consumer

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More AWS Quizzes