SQS 延迟是否适用于 FIFO 队列的队列级别或消息组级别?
Will an SQS delay apply at the queue level or message group level of a FIFO queue?
AWS SQS FIFO 队列的批处理设置为 1,延迟为 1 秒。收到的每个项目都与一个 MessageGroup 相关联。
队列同时收到 10 个不同消息组中的 30 条消息,每个消息组占 3 条消息...
一秒的延迟是否适用于队列级别,即 30 条消息将花费 30 秒的时间来传送?
或者队列会启动 10 个消费者,每个消息组一个,在 3 秒内清空队列?
Will the delay of one second apply at the queue level i.e. the 30 messages will take an elapsed time of 30 seconds to deliver?
对于 FIFO,延迟应用于队列 level:
FIFO queues don't support per-message delays, only per-queue delays. If your application sets the same value of the DelaySeconds parameter on each message, you must modify your application to remove the per-message delay and set DelaySeconds on the entire queue instead.
并行工作的 comsumer lambda 的数量不需要像写的那样是 10 bellow:
In SQS FIFO queues, using more than one MessageGroupId enables Lambda to scale up and process more items in the queue using a greater concurrency limit. Total concurrency is equal to or less than the number of unique MessageGroupIds in the SQS FIFO queue.
因此,与组相比,您可以拥有更少的消费者 lambda。但在理想情况下,您将有 10 个 lambda 并行工作。下面的 AWS 博客 post:
解释了它如何与 lambda 一起工作
AWS SQS FIFO 队列的批处理设置为 1,延迟为 1 秒。收到的每个项目都与一个 MessageGroup 相关联。
队列同时收到 10 个不同消息组中的 30 条消息,每个消息组占 3 条消息...
一秒的延迟是否适用于队列级别,即 30 条消息将花费 30 秒的时间来传送?
或者队列会启动 10 个消费者,每个消息组一个,在 3 秒内清空队列?
Will the delay of one second apply at the queue level i.e. the 30 messages will take an elapsed time of 30 seconds to deliver?
对于 FIFO,延迟应用于队列 level:
FIFO queues don't support per-message delays, only per-queue delays. If your application sets the same value of the DelaySeconds parameter on each message, you must modify your application to remove the per-message delay and set DelaySeconds on the entire queue instead.
并行工作的 comsumer lambda 的数量不需要像写的那样是 10 bellow:
In SQS FIFO queues, using more than one MessageGroupId enables Lambda to scale up and process more items in the queue using a greater concurrency limit. Total concurrency is equal to or less than the number of unique MessageGroupIds in the SQS FIFO queue.
因此,与组相比,您可以拥有更少的消费者 lambda。但在理想情况下,您将有 10 个 lambda 并行工作。下面的 AWS 博客 post:
解释了它如何与 lambda 一起工作