如何快速从 Amazon SQS(简单队列服务)队列中删除事件?
假设我的 SQS 队列中有数百万个事件,我想快速删除它们,但我不能只删除队列并创建一个新队列。
从队列中删除/排出这些事件的最快方法是什么?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我假设您不关心消息中的值,因为您似乎想要耗尽它而不是处理它。您可以将 MessageRetentionPeriod 设置为非常低的值,然后将所有剩余消息从队列中排出。耗尽后,将 MessageRetentionPeriod 设置回所需的值。您将丢失所有早于 MessageRetentionPeriod 的消息。
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.