我有兴趣用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?
发布于 2019-12-26 19:21:32
怀疑这里的答案是每个“分区”使用一个队列,因为SQS定价是基于每个消息的,而不是每个队列的。如果你有很多“分区”,那么在堆栈启动过程中以编程方式创建它们(例如作为CodeBuild脚本的一部分),而不是在CloudFormation中定义每个队列。
https://stackoverflow.com/questions/59478426
复制相似问题