如何真正快速地从Amazon SQS(简单队列服务)队列中删除事件? [英] How to delete events from an Amazon SQS (Simple Queue Service) queue really fast?

查看:98
本文介绍了如何真正快速地从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?

推荐答案

我假设您不关心消息中的值,因为您似乎想消耗掉它而不是对其进行处理.您可以将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.

这篇关于如何真正快速地从Amazon SQS(简单队列服务)队列中删除事件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆