AWS SQS to Lambda Failed Processed Messages

Here’s a corrected version of your text:

Imagine a scenario where a Lambda function polls messages from an SQS queue but fails to process some messages.

Issue

During batch processing, SQS doesn’t track what happens after triggering La…


This content originally appeared on DEV Community and was authored by MacAndersonUche

Here’s a corrected version of your text:

Imagine a scenario where a Lambda function polls messages from an SQS queue but fails to process some messages.

Image description

Issue

During batch processing, SQS doesn't track what happens after triggering Lambda. If a message fails or is throttled, it remains invisible until deleted or made visible again after the VisibilityTimeout expires. Throttled messages are treated as failures, and their ReceiveCount increases each time they're retried. If a large number of messages arrives, some may be throttled and retried repeatedly until they reach the maxReceiveCount and are moved to the Dead Letter Queue (DLQ).

Fix

We implemented two solutions:

  1. maxReceiveCount: We increased the maxReceiveCount from 1 to 6 in the SQS queue. This was configured using CloudFormation:
   Queue:
     Type: AWS::SQS::Queue
     Properties:
       RedrivePolicy:
         maxReceiveCount: 6
  1. VisibilityTimeout: We increased the VisibilityTimeout from 40 to 120 seconds. This was done using CloudFormation:
   Queue:
     Type: AWS::SQS::Queue
     Properties:
       VisibilityTimeout: 120
       DelaySeconds: 30


This content originally appeared on DEV Community and was authored by MacAndersonUche


Print Share Comment Cite Upload Translate Updates
APA

MacAndersonUche | Sciencx (2024-09-18T22:30:40+00:00) AWS SQS to Lambda Failed Processed Messages. Retrieved from https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/

MLA
" » AWS SQS to Lambda Failed Processed Messages." MacAndersonUche | Sciencx - Wednesday September 18, 2024, https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/
HARVARD
MacAndersonUche | Sciencx Wednesday September 18, 2024 » AWS SQS to Lambda Failed Processed Messages., viewed ,<https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/>
VANCOUVER
MacAndersonUche | Sciencx - » AWS SQS to Lambda Failed Processed Messages. [Internet]. [Accessed ]. Available from: https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/
CHICAGO
" » AWS SQS to Lambda Failed Processed Messages." MacAndersonUche | Sciencx - Accessed . https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/
IEEE
" » AWS SQS to Lambda Failed Processed Messages." MacAndersonUche | Sciencx [Online]. Available: https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/. [Accessed: ]
rf:citation
» AWS SQS to Lambda Failed Processed Messages | MacAndersonUche | Sciencx | https://www.scien.cx/2024/09/18/aws-sqs-to-lambda-failed-processed-messages/ |

Please log in to upload a file.




There are no updates yet.
Click the Upload button above to add an update.

You must be logged in to translate posts. Please log in or register.