当消息被发送到 DLQ

When a message being sent to DLQ

我正在尝试了解何时以及通过什么触发器可以将消息抛出到 DLQ。

例如,下面有一个架构,其中 SNS 将消息生成到 SQS 和一些 Spring 服务 使用此 SQS。

如果我们将 DLQ 附加到 主队列 ,我们可以配置 Maximum receives 参数(如下所示)。我没有从文档中得到它,例如,如果 Maximum receives 等于 1,并且 Spring Service 尝试使用来自 SQS 的消息并在第一次尝试后由于某种原因失败,该消息将进入 DLQ,对吗?

所以,如果我们想给Spring服务更多的消费尝试,我们需要增加Maximum receives参数吗?

And so, if we want to give the Spring Service a few more attempts for consumption a message we need to increase Maximum receives parameter?

是的。那就对了。为了尽量减少这种情况,您必须确保 SQS visibility timeout is adequate for the processing. If the processing time is variable, you can also modify the visibility time per message,例如通过在您的 spring 应用程序中将其延长 30 秒。