[英]No bugs in codes, why messages are still being sent to Dead Letter Queue?
I have 2 Lambda functions that respectively sent and received some workloads via a SQS.我有 2 个 Lambda 函数,它们分别通过 SQS 发送和接收一些工作负载。 But many messages are unexpectedly sent to DLQ.但是许多消息意外地发送到 DLQ。 I am confident that it wasn't caused by in-code bugs because not all messages went to DLQ.我确信这不是由代码中的错误引起的,因为并非所有消息都发送到 DLQ。
I set reservedConcurrentExecutions = 1
and maxReceiveCount = 1
, does it matter?我设置了reservedConcurrentExecutions = 1
和maxReceiveCount = 1
,这有关系吗? I'm thinking if I increase maxReceiveCount
perhaps fewer messages will be sent to DLQ.我在想,如果我增加maxReceiveCount
,发送到 DLQ 的消息可能会更少。
Anyhow, I hope somebody can walk me through the methodology behind that.无论如何,我希望有人能带我了解这背后的方法。
Increasing maxReceiveCount
worked eventually.增加maxReceiveCount
最终起作用了。 The official developer guide says:官方开发人员指南说:
If your function returns an error, or can't be invoked because it's at maximum concurrency, processing might succeed with additional attempts. To give messages a better chance to be processed before sending them to the dead-letter queue, set the maxReceiveCount on the source queue's redrive policy to at least 5.
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.