Sajin Surendran
Sajin Surendran

Reputation: 284

Limiting redrive from AWS DLQ

I have SQS->Lambda set up with SQS attached to DLQ with proper redrive policy based on maxReceiveCount. I would like to redrive failed messages from DLQ to source queue for three times after some interval. I know DLQ supports redrive to SQS but Is there any way to limit the redrive to some specific times? One option I can think is triggering a lambda scheduler and poll messages from DLQ and send to the source SQS after validating some custom header attached (like maxAttempts).

Upvotes: 0

Views: 545

Answers (1)

Kavindu Vindika
Kavindu Vindika

Reputation: 2747

I think it's better to define maxReceiveCount as 3 in your queue and then move the failed messages to DLQ if max receive count exceeds 3. Now you don't need to redrive them to source queue.

Then you can analyse the failed messages in DLQ if necessary without any additional integrations to restrict moving them to source queue. If required, you can decide to redrive them or not.

Upvotes: 0

Related Questions