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.
Anthony neace
source share