I have two queues SQS a
and b
and i want to move all messages from one queue to another using Python boto library. This is how I tried to do this:
rs = a.get_messages()
while rs:
msg = rs[0]
if not msg:
break
b.write(msg)
a.delete_message(msg)
rs = a.get_messages()
After I executed that code I see no messages in 'a' (expected) and no messages in b
(not expected!). It's probably because I put the same object to the new queue and deleted it. So is there any way to copy message to put the copy to the new queue instead of putting the original object? Or there is something else that I'm doing wrong here?