Should wait queue messages read "In Flight" in SQS?

I am working on a project in which I intend to use Amazon SQS latency .

I'm having trouble understanding what is meant by "inflight" messages.

There is a note in the documentation:

Note

There is a limit of 120,000 for the number of queues. Messages appear after they have been received by the queue, but have not yet been removed from the queue. If you reach 120,000, you will receive an OverLimit error message from Amazon SQS. To avoid the restriction, you should remove messages from the queue after processing them. You can also increase the number of queues that you use to process messages.

But I'm not quite sure what is considered “received in line.” In the flowchart, where is the message “received” in the queue?

enter image description here

I will have many messages that are specially delayed (in the first blue bar of the diagram), but not so much in the "visibility" phase (second blue bar).

Treating both blue stripes as ceiling posts? Or is this message only “inflight” after it was “received” by the ReceiveMessage request (to the right of “Message returned” at the bottom of the diagram)?

+8
queue amazon-web-services amazon-sqs delay
source share
1 answer

Messages that are thrown into the delay queue are not immediately counted as "In Flight" because they are invisible to any consumers. They don’t count as Available or In Flight, they simply aren’t visible to you.

You can verify this with a simple experiment on the AWS SQS console:

  • Create a wait queue and open two tabs for the SQS console.
  • Drop several messages into the waiting queue by right-clicking in turn and selecting “Send message” - you should notice that these messages are not considered “Available” or “In Flight” before the expiration of the delay period at which they become “available”.

As the documentation says, the messages are "in flight" after they have been received (although they are processed by some application), but before they are deleted. If they are not deleted when the application terminates, they return to the "Available" state.

You can verify this with a second experiment on the AWS SQS console:

  • Open two tabs in the AWS SQS console. Create several messages in the waiting queue and wait for them to appear.
  • On the first tab, right-click in turn and select "View / Delete Messages." In this experiment, the View / Delete Messages dialog is similar to your application - it processes the queue message while viewing it. Set the "Poll the message queue" text box for a sufficiently long period and start polling the messages. If your messages are available, they should appear immediately.
  • On the second tab, update the SQS console. You should notice that these messages are now “In Flight”, since the messages were received when you view them in another tab.

Since your “In-Flight” messages are messages that are currently being processed by your application, the depth of the queue message in this column should not realistically grow very large. Delete your messages after processing them (or try again → process properly, then delete / go to another queue to handle the exception), and you should be fine.

+9
source share

All Articles