AWS SQS 消息保留期 [英] AWS SQS message retention period

查看:35
本文介绍了AWS SQS 消息保留期的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

根据 文档 最长 SQS 消息保留期 (MessageRetentionPeriod) 为 14 天.过了那个时间,消息就会从队列中删除.

According to documentation the maximum SQS message retention period(MessageRetentionPeriod) is 14 days. After that time message will be deleted from the queue.

SQS 有什么办法可以在保留期到期后不丢失这些消息?比如不清楚或者可以用Dead Letter Queue来做这个吗?

Is any way with SQS to not lose these messages after their retention period expired? For example, it is not clear or is it possible to use Dead Letter Queue for this purpose?

推荐答案

14 天是您可以保留消息的最大限制.14 天后,您可以将该消息移至 S3 Bucket 进行备份.您还可以使用 DLQ 进行破解.

Well 14 days is the max limit you can keep the message. After 14 days you can move that message to S3 Bucket for backup. Also there is a hack you can do with DLQ.

这是一个快速的技巧,您可以在其中将该消息发送回主队列.这绝对不是最好或推荐的选项.

Here is a quick hack where you send that message back to the main queue. This is definitely not the best or recommended option.

  1. 将主 SQS 队列设置为具有最大值的实际 DLQ 的 DLQ接收为 1.
  2. 查看 DLQ 中的内容(这会将消息移到主队列,因为这是实际 DLQ 的 DLQ)
  3. 删除设置,使主队列不再是主队列的 DLQ实际 DLQ

这篇关于AWS SQS 消息保留期的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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