Resources Required to Process Messages

To help you estimate the amount of resources needed to process your queued messages, Amazon SQS can provide you with an approximate number of messages in a queue. You can view the number of messages that are visible or you can view the number of messages that are not visible. Messages that are not visible are messages in a queue that are not timed-out and not deleted. For more information about visibility, see Visibility Timeout.

[Important]Important

Because of the distributed architecture of SQS, the result is not an exact count of the number of messages in a queue. In most cases it should be close to the actual number of messages in the queue, but you should not rely on the count being precise.

The following table lists the API action to use.

To do this... Use this action

Get the approximate number of messages in the queue

GetQueueAttributes

Get the approximate number of messages in the queue that are not visible

GetQueueAttributes