amazon-sqs

How to get receipt handle from sqs queue response, getting(TypeError 'sqs.Message' object is not subscriptable

How to get receipt handle from sqs queue response, getting(TypeError 'sqs.Message' object is not subscriptable Question: 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 …

Total answers: 1

Number of deleted messages is twice as many as received messages

Number of deleted messages is twice as many as received messages Question: I created SQS service with terraform resource "aws_sqs_queue" "ses_queue" { name = "ses_queue" message_retention_seconds = 86400 receive_wait_time_seconds = 1 visibility_timeout_seconds = 15 } resource "aws_lambda_event_source_mapping" "send_email_message" { event_source_arn = aws_sqs_queue.ses_queue.arn function_name = aws_lambda_function.send_email_message.function_name batch_size = 5 } I am sending emails using lambda …

Total answers: 2

botot3 with sqs: the address 'QueueUrl' is not valid for this endpoint

botot3 with sqs: the address 'QueueUrl' is not valid for this endpoint Question: I am trying to the get queue url from a SQS queue. I have read about other posts Set the endpoint for boto3 SQS and boto3 sqs incorrect url when not specified endpoint url but it is still puzzling why the code …

Total answers: 1

Cannot parse SQS Json response

Cannot parse SQS Json response Question: I have created a consumer to gather bounces and complaints in an SQS Queue. It is working for the majority of my messages, but there are some messages coming in that are throwing an Exception. The JSON output that works: {"notificationType":"Complaint","complaint":{"feedbackId":"0100018217177664-7d73c160-0be8-49aa-b9c4-bd1d1aebd362-000000","complaintSubType":null,"complainedRecipients":[{"emailAddress":"[email protected]"}],"timestamp":"2022-07-19T15:33:09.000Z","userAgent":"Yahoo!-Mail-Feedback/2.0","complaintFeedbackType":"abuse","arrivalDate":"2022-07-08T12:58:35.000Z"},"mail":{"timestamp":"2022-07-08T12:58:34.633Z","source":"[email protected]","sourceArn":"arn:aws:ses:us-east-1:669689702539:identity/example.com","sourceIp":"12.34.56.789","callerIdentity":"ses-smtp-user.20190509-104648","sendingAccountId":"1234567890","messageId":"01000181dde3fb09-77fa66a7-6425-4a17-974c-5b49c8ab930d-000000","destination":["[email protected]"],"headersTruncated":false,"headers":[{"name":"Received","value":"from mail-aws-va-1 ([12.34.56.789]) by email-smtp.amazonaws.com with SMTP (SimpleEmailService-d-9BN0NGUJI) id …

Total answers: 1

AWS Lambda and SQS, reserved header X-Amzn-Trace-Id error

AWS Lambda and SQS, reserved header X-Amzn-Trace-Id error Question: Edit* Looks like it was fixed. https://github.com/boto/botocore/commit/315c8353228fa03e2d613a4f3d94119ed9c3c6b0 I am trying to send a message to a standard AWS SQS queue using a Lambda function running Python 3.9. When i send the message like this using the ‘Test’ function in the AWS console or if the function …

Total answers: 2

how to implement exponential backoff in amazon sqs without writing code

how to implement exponential backoff in amazon sqs without writing code Question: I have a simple task that requires a 3rd party. When a request comes, I push it to an amazon sqs queue, pull it in a worker and call the 3rd party. In case of a time out, I want to implement an …

Total answers: 2

How to peek at messages in the queue

How to peek at messages in the queue Question: I don’t want the message to count as “read” but I’d like to know what’s in the queue. The documentation: http://boto.s3.amazonaws.com/ref/sqs.html#module-boto.sqs Isn’t very straight forward about what absorbs a message and what doesn’t. The dump message seems close, but I’d rather do this in memory rather …

Total answers: 5