简体   繁体   English

AWS 控制台如何为 FIFO 队列接收具有相同消息组 ID 的多条消息?

[英]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:然后:

  1. 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以及消息正文A1A2A3

  2. 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.

相关问题 两个 AWS SQS FIFO 队列消费者何时可以处理具有相同组消息 ID 的消息? - When can two AWS SQS FIFO queue consumers process messages with the same group message id? AWS SQS 接收消息——如何知道队列何时为空 - AWS SQS Receive Messages -- How to Know when Queue is Empty aws FIFO队列返回空队列,即使它有可用的消息 - aws FIFO queue returns empty queue even though it has messages available AWS Lambda 如何确定消息是否仍在 SQS 队列中? - How does AWS Lambda determine if messages are still in SQS queue? Kdb AWS FIFO 队列接口 - Kdb AWS FIFO Queue interface AWS SQS MessageGroupId 是否保证同一组的消息由同一个lambda处理? - Does AWS SQS MessageGroupId ensure that messages of the same group are handled by the same lambda? 使用 boto 库接收 AWS SQS 队列中的所有消息,直到队列为空 - Receive all messages in AWS SQS queue using boto library until queue is empty 如何从在自动缩放组后面运行并连接到 jms 队列的 aws ecs docker 容器中排出消息 - How to drain message from aws ecs docker container which is running behind autoscaling group and connected to jms queue google pub sub 是否将消息传递到具有相同消息 ID 的死信队列? - Does google pub sub deliver messages to dead letter queues with the same message id? 如何正确地将消息发送到队列 - Javascript / AWS - How to correctly send a message to the Queue - Javascript / AWS
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM