Dal*_*usR 4 amazon-sqs amazon-web-services aws-lambda
I've observed an abnormal (well, in my POV) feature, where when I setup SQS to trigger a Lambda, when new messages arrive, lambdas get triggered with more than 1 record/message inside its event body.
Full setup is S3 (PutObjectEvent) -> SNS topic -> SQS -> Lambda.
The abnormal behaviour is that for example, let's say I put 15 objects inside S3, which then forwards an event to SNS per each object, which then I can observe, SQS gets populated with 15 messages. However, when Lambdas start triggering, out of those 15 messages, only 11 Lambdas trigger, some of them containing more than 1 record/message inside its event body.
我已经搜索过AWS文档,但没有找到具体答案。请注意,这些Lambda不会轮询SQS或失败或继续重试。他们执行得很好,只是被检查的事件主体在其中显示了1条以上的记录。
在此处查看 SQS Lambda消息的样本事件数据。该消息是一个记录数组,直接表明该消息中可能有多个SQS记录。
有关SQS Lambda集成的文档还明确指出,该Batch Size设置控制一次调用中Lambda函数可以从SQS接收多少条记录,默认值为10。如果只希望Lambda函数一次接收一条消息,则需要将Batch Size设置修改为1。
| 归档时间: |
|
| 查看次数: |
3683 次 |
| 最近记录: |