I have a case where a script is writing all unused volume ids to AWS SQS queue and after some time, we need to receive all those messages with volume ids and delete those volumes. Is there a way to achieve this using python boto library?
Receive all messages in AWS SQS queue using boto library until queue is empty
Your Python script should use the boto3 receive_message()
command:
Retrieves one or more messages (up to 10), from the specified queue.
Once your program has finished processing a message, it should call delete_message()
or delete_message_batch()
to delete the message, passing the ReceiptHandle
for each message that was obtained from the receive_message()
call.
To process all messages in the queue, continue receiving and deleting messages within a loop.