[英]How does the AWS Console receive multiples messages with same message group ID for a FIFO queue?
I created a test SQS FIFO queue test.fifo
- see screenshot below.我创建了一个测试 SQS FIFO 队列
test.fifo
- 请参见下面的屏幕截图。
Then:然后:
I sent three messages to it with message-group-id = A
, and message bodies A1
, A2
and A3
respectively using AWS Console (via Send and receive messages
button).我使用 AWS 控制台(通过“
Send and receive messages
”按钮)分别向其发送了三条消息, message-group-id = A
以及消息正文A1
、 A2
和A3
。
Using AWS Console again, I polled for messages with 10 seconds polling, two times in a row.再次使用 AWS 控制台,我连续两次以 10 秒的轮询时间轮询消息。 Every time, I saw all three messages in results, and I could open and see the message bodies for all.
每次,我都会在结果中看到所有三封邮件,而且我可以打开并查看所有邮件正文。
Without deleting any message after receiving, how was I able to see all messages with same message-group-id at once?收到后不删除任何消息,我怎么能一次看到所有具有相同消息组 ID 的消息? Isn't that a violation of FIFO nature of the queue?
这不是违反队列的 FIFO 性质吗?
Isn't that a violation of FIFO nature of the queue?
这不是违反队列的 FIFO 性质吗?
No, of course not.不,当然不是。
FIFO's main guarantee is around ordering , which would have been preserved in the console and you would have seen the messages in the same order you sent them. FIFO 的主要保证是关于排序的,它会保留在控制台中,您会看到消息的顺序与发送它们的顺序相同。
It guarantees exactly-once processing , not exactly-one-message-being-received-at-a-time .它保证exactly-once processing ,而不是exactly-one-message-being-received-at-a-time 。
You can receive multiple messages at once, as mentioned in the FIFO docs :您可以一次接收多条消息,如FIFO 文档中所述:
It is possible to receive up to 10 messages in a single call using the MaxNumberOfMessages request parameter of the ReceiveMessage action.
使用 ReceiveMessage 操作的 MaxNumberOfMessages 请求参数,可以在一次调用中接收最多 10 条消息。 These messages retain their FIFO order and can have the same message group ID .
这些消息保留其 FIFO 顺序并且可以具有相同的消息组 ID 。 Thus, if there are fewer than 10 messages available with the same message group ID, you might receive messages from another message group ID, in the same batch of 10 messages, but still in FIFO order.
因此,如果具有相同消息组 ID 的可用消息少于 10 条,您可能会在同一批 10 条消息中收到来自另一个消息组 ID 的消息,但仍按 FIFO 顺序接收。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.