在 Amazon SQS 中轮询期间消息会发生什么情况?

What happen to a message during poll in Amazon SQS?

当我经历这个时Amazon SQS Document 我发现

The queue (which holds messages A through E) redundantly stores the messages across multiple Amazon SQS servers.

所以,我的问题是当我从 SQS 轮询 Message A 时,这个 Message A 是否来自单个服务器?那么存储在不同服务器上的消息发生了什么?它们如何在可见超时之前保持不可见或在消费者处理后删除消息时被删除?

每当您与 AWS 服务交互时,您只会接触一台服务器进行 API 交互(尽管这不是队列存在的同一台服务器,它只是前置 API).

为了了解引擎盖下发生的事情,您只能推测,但是根据其他服务的工作方式,该服务将尝试从队列中获取项目,同时更新项目的可见性。这将并行发送到包含排队项目的所有节点。然后这些会返回给您。

查看文档说明如下

Standard queues support at-least-once message delivery. However, occasionally (because of the highly distributed architecture that allows nearly unlimited throughput), more than one copy of a message might be delivered out of order.

从这一行开始,它指出 at-least once,这表明在所述期间内始终有可能多次传递一条消息。