I can see messages have a sent time when I view them in the SQS message view in the AWS console. How can I read this data using Python's boto library?
When you read a message from a queue in boto, you get a Message
object. This object has at attribute called attributes
. It is a dictionary of attributes that SQS keeps about this message. It includes SentTimestamp
.
You can use the attributes parameter of the get_message() method. See the documentation.
queue.get_messages(attributes=['All'])
The documentation also says that you can do this with the read() method but this is broken right now. I opened an issue for this on the project site: https://github.com/boto/boto/issues/2699.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With