Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to delete events from an Amazon SQS (Simple Queue Service) queue really fast?

Suppose that I have many millions of events in a SQS queue and I want to get rid of them quickly, but I cannot just delete the queue and make a new one.

What is the fastest way to delete/drain those events out of the queue?

like image 657
Desmond Zhou Avatar asked Oct 25 '11 17:10

Desmond Zhou


1 Answers

I'm assuming that you don't care about the values in the messages, since you appear to want to drain it rather than process it. You can set the MessageRetentionPeriod to a very low value, and then drain any remaining messages out of the queue. After its drained, set the MessageRetentionPeriod back up to the desired value. You'll lose any messages that are older than the MessageRetentionPeriod.

like image 133
Kent Murra Avatar answered Sep 25 '22 08:09

Kent Murra