代码中没有错误,为什么仍将消息发送到Dead Letter队列?

发布于 2025-01-22 19:03:07 字数 267 浏览 0 评论 0原文

我有2个Lambda功能,分别通过SQ发送并接收了一些工作负载。但是许多消息出乎意料地发送到DLQ。我相信这不是由内部错误引起的,因为并非所有消息都涉及DLQ。

我设置保留concurrentexecutions = 1maxReceiveCount = 1,这有关系吗?我在想,如果我增加了maxReceiveCount可能会将较少的消息发送到DLQ。

无论如何,我希望有人可以引导我完成背后的方法。

I have 2 Lambda functions that respectively sent and received some workloads via a SQS. But many messages are unexpectedly sent to DLQ. I am confident that it wasn't caused by in-code bugs because not all messages went to DLQ.

I set reservedConcurrentExecutions = 1 and maxReceiveCount = 1, does it matter? I'm thinking if I increase maxReceiveCount perhaps fewer messages will be sent to DLQ.

Anyhow, I hope somebody can walk me through the methodology behind that.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

瀟灑尐姊 2025-01-29 19:03:07

增加MaxReceiveCount最终工作。官方开发人员指南说:

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.

Increasing maxReceiveCount worked eventually. 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.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文