mardi 5 mai 2015

How to retrieve attributes of message written to a SQS queue using Boto?

I have the following code snippet.

conn = boto.sqs.connect_to_region(region)
q = conn.lookup('myqueue')
m = Message()
m.set_body('My Message')
data = {"UserID": {"data_type": "Number","string_value": "11111"}}
m.message_attributes = user_data
q.write(m)

Using this, I have successfully written the attributes I wanted with the message. Now, I wanted to retrieve it. I have tried

msg.message_attributes

But I have got an empty dictionary only.

Is this the way to retrieve it? Or am I wrong somewhere?




Aucun commentaire:

Enregistrer un commentaire