I'm working on a project in which I intend to use an Amazon SQS Delay Queue.
I'm having a bit of trouble understanding exactly what is meant by "inflight" messages.
There is a note in the documentation that says:
Note
There is a 120,000 limit for the number of inflight messages per queue. Messages are inflight after they have been received by the queue, but have not yet been deleted from the queue. If you reach the 120,000 limit, you will receive an OverLimit error message from Amazon SQS. To help avoid reaching the limit, you should delete the messages from the queue after they have been processed. You can also increase the number of queues you use to process the messages.
But I'm not entirely sure what is considered being "received by the queue." In the flow diagram, where is a message "received" by the queue?
I will have a lot of messages purposely delayed (in the first blue bar of the diagram) but not many in the "visibility timeout" phase (second blue bar).
Do both blue bars count as "inflight" messages? Or is a message only "inflight" after it has been "received" by a ReceiveMessage
request (to the right of "Message returned" at the bottom of the chart)?
Messages that are dropped into a Delay Queue are not immediately counted as "In Flight", since they are invisible to any consumers. They aren't counted as "Available" or "In Flight", they just aren't visible to you.
You can verify this with a simple experiment on the AWS SQS console:
As the documentation says, messages are "In Flight" after they have been received (while they are being handled by some application) but before they have been deleted. If they are not deleted when the application has finished with them, they return to an "Available" state.
You can verify this with a second experiment on the AWS SQS console:
Since your "In Flight" messages are messages that are presently being handled by your application, the queue message depth in that column shouldn't realistically grow very large. Delete your messages after handling them (or retry->appropriately handle then delete/move to another queue to process on an exception) and you should be okay.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With