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

妖精的绣舞 提交于 2019-12-04 21:46:46

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7893535/how-to-delete-events-from-an-amazon-sqs-simple-queue-service-queue-really-fast

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!