How to get receipt handle from sqs queue response, getting(TypeError 'sqs.Message' object is not subscriptable
I have one queue I'm sending some message in that and want to get receipt handle from output response.
messages = queue.receive_messages()
print(messages)
I am receiving this type of response:
[sqs.Message(queue_url='someurl', receipt_handle='abcd')]
Now I want to extract only receipt handle from the response, here what I have tried
message = messages[0]
receipt_handle = message['receipt_handle']
print(receipt_handle)
but I'm getting below error:
TypeError 'sqs.Message' object is not subscriptable
How can I get receipt_handle from response?
source https://stackoverflow.com/questions/75346677/how-to-get-receipt-handle-from-sqs-queue-response-gettingtypeerror-sqs-messag
Comments
Post a Comment