Boto3: BOTO3: queue.count() & queue.get_messages()

Created on 20 Apr 2016  路  2Comments  路  Source: boto/boto3

Team,
queue.count() & queue.get_messages() doesn't work with boto3 in python3.4.

Also is there any way of getting total number of messages in a queue? or queue size ? it is becoming really difficult to work on application which require to iterate over messages already in SQS queue ?

guidance sqs

Most helpful comment

You get messages with recieve_messages. You can get the approximate number of messages from the queue attributes, specifically look for the key ApproximateNumberOfMessages.

All 2 comments

You get messages with recieve_messages. You can get the approximate number of messages from the queue attributes, specifically look for the key ApproximateNumberOfMessages.

Having a queue instance, how can we update the attributes so we keep track of the number of messages? Does the approximate number stick when the Queue object is instantiated without getting updated afterwards?

Was this page helpful?
0 / 5 - 0 ratings