I have a dead queue with over 30,000 messages and I need to get them processed

So we have a sns → sqs → lambda .

Due to a rushed go live deployment orchestrated by an incompetent corporate andy manager, we are facing various problems due to inadequate scoping on the deployment.

Anyways for my specific issue, I have 30k messages in a dead queue and I need to move them to the live queue. We had a timed task with event bridge (done by a lambda) that would move the messages from the dead queue to the live queue but that task is timing out due to the large amount of messages needed to be pull.

Why are there 30k messages in the first place? Due to the rushed launch.

What should I do at this point?

  1. I heard you can subscribe the dead queue to a consumer? Should I subscribe the dead queue to the consumer (lambda)?

  2. Increase the memory and timeout of the lambda that is scheduled under event bridge and hopefully it won’t time out? Increase the visibility timeout of the messages to some large amount when pulling them as well?

  3. I tried testing with a script to grab sqs messages, send them to the live queue, and delete them but this is taking forever. I tried it in a dev environment with a similar amount of sqs messages and over night it only processed about half. (~16,000)

Yeah I know there are probably bad practices here but the team is hopefully trying to get all 30,000k messages processed.

Anyways I am at wit’s end so just hoping for some helpful advice.


Related discussions:

^^ Sounds like you’re trying to pull every message at once instead of processing them in batches of 10 like the default is (was?).

I’ve been using SQS for years and only recently found out theres an automatic replay button now in the AWS console.

You should be able to have AWS automatically move the messages from my DLQ to live queue for you with the click of a button in the UI, no need for any custom receiving/sending logic to move them.

Edit: removed the wrong link. This looks like the proper one

https://aws.amazon.com/blogs/aws/enhanced-dlq-management-sqs/

That’s new functionality from reinvent 2021

Only available through the console though :frowning:

Thank you for the find. You just saved me a lot of headache and time.