[英]How to add failure messages to DLQ when lambda is invoked synchronously?
I have structure similar to this我有类似的结构
SQS -> Lambda -> DLQ
SQS -> Lambda -> DLQ
When Lambda is invoked asynchronously like below then failure messages are getting added successfully to DLQ.当像下面这样异步调用 Lambda 时,失败消息将成功添加到 DLQ。
$ aws lambda invoke --function-name my-function --invocation-type Event --payload '{ "key": "value" }' response.json
But when lambda gets triggered on adding new messages to SQS then on failure, messages doesn't store in DLQ.但是当 lambda 在向 SQS 添加新消息时被触发然后失败时,消息不会存储在 DLQ 中。
I found that events triggered when new message published to SQS are synchronous in nature.我发现当新消息发布到 SQS 时触发的事件本质上是同步的。
Lambda polls the queue and invokes your function synchronously with an event that contains queue messages.
Lambda 轮询队列并使用包含队列消息的事件同步调用您的函数。
Reference - https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html .参考 - https://docs.aws.amazon.com/lambda/latest/dg/with-sqs.html 。
So I want either-所以我要么——
or要么
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.