Testing Retry Behavior and DLQs in AWS Lambda
ฝัง
- เผยแพร่เมื่อ 21 ส.ค. 2024
- Dead-letter queues are useful for debugging your application or messaging system because they let you isolate problematic messages to determine why their processing doesn't succeed.
Prerequisite:
--------------------
AWS SQS | AWS Simple Queue Service | How SQS Works | AWS Tutorial
• AWS SQS | AWS Simple Q...
AWS Lambda Destinations tutorial | Synchronous Vs Asynchronous Invocation
• AWS Lambda Destination...
Lambda Code:
-----------------------
import json
import time
def lambda_handler(event, context):
TODO implement
print(event)
time.sleep(3)
return {
'statusCode': 200,
'body': json.dumps('Hello from Lambda!')
}
Check this playlist for more AWS Projects or POC in Big Data domain:
• Demystifying Data Engi...
I guess the delay is due to the fact that Lambda retries two times apart from the original execution. So in total = 3 executions that takes 1 min + 2 min = 3 mins to reach the DLQ.
Very usefull, thank you.
Glad to hear that!
Is there a way to test it using invoke lambda subcommand using CLI? (Without attaching a SNS or SQS trigger to Lambda)
Hello Andrew Ribeiro, you can refer this -- docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html Happy Learning