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 ?
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?
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 keyApproximateNumberOfMessages.