I have an SQS queue linked to a deadletter queue via a redrive policy. Terraform sample:
redrive_policy = jsonencode({
deadLetterTargetArn = aws_sqs_queue.deadletter_queue.arn
maxReceiveCount = 10
})
The queue processing is implemented with exponential backoff. If processing is successful the message is simply deleted. If processing fails it retries with an initial VisibilityTimeout
of 30 seconds, which doubles each time, the final retry timeout (between 9th and 10th attempt) is roughly 2 hours.
My question is, after the final retry, when does the message get sent to the deadletter queue? Immediately after the 10th attempt or does it have to wait out the VisibilityTimeout
(of about 4 hours)?.
My concern is that it seems redundant to put a visibility timeout on a message if it's just going to be sent straight to the deadletter - this delays alerts for example.