【发布时间】:2019-12-25 12:30:32
【问题描述】:
我有兴趣用 SQS 替换 Kinesis(因为它很贵而且我不需要历史日志),但我需要一个分片/分区机制,特别是在使用 Lambda 处理时。
我看到 SQS FIFO 队列最近获得了 Lambda 事件映射 -
https://aws.amazon.com/blogs/compute/new-for-aws-lambda-sqs-fifo-as-an-event-source/
我认为通过使用MessageGroupID 可以使分区非常接近。
消息处理被描述为通过以下规则进行 -
1) Return the oldest message where no other message with the same MessageGroupId is in flight.
2) Return as many messages with the same MessageGroupId as possible.
3) If a message batch is still not full, go back to the first rule. As a result, it’s possible for a single batch to contain messages from multiple MessageGroupIds.
1) 和 2) 听起来很棒 - 每个 Lambda 请求批次只包含一个 MessageGroupID - 但是 3) 似乎把一切都搞砸了:-(
对确保每个 Lambda 请求批次仅包含来自单个 MessageGroupID 的消息的策略有何想法?可能通过MessageDeduplicationID ?
【问题讨论】:
标签: amazon-web-services amazon-sqs amazon-kinesis