我正在使用Python Boto 2.8,但是我无法删除消息。以下是我的测试代码:
conn = boto.sqs.connect_to_region("us-east-1",
aws_access_key_id=AWS_ACCESS_KEY,
aws_secret_access_key=AWS_SECRET_KEY)
q = conn.get_queue("sqs_bounces")
q.set_message_class(RawMessage) //need this to be able to get message as json
results = q.get_messages(num_messages=10,visibility_timeout=30,wait_time_seconds=10)
for rs in results:
str = rs.get_body()
print str
result = json.loads(str)
rs = json.loads(result["Message"])
print rs["notificationType"]
#get the email and save it as bounced
// Do saving.....
#Delete message
//How do i delete the current message?
有人能告诉我如何删除这个吗?有时我会收到1条消息,有时候是3条。而且我不想在每次拉取之后保存相同的退信邮件,所以我需要在保存后将其删除。
谢谢