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...

ความคิดเห็น • 5

  • @kishoru3475
    @kishoru3475 ปีที่แล้ว +1

    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.

  • @ivanjuarez6049
    @ivanjuarez6049 11 หลายเดือนก่อน +1

    Very usefull, thank you.

  • @andrewribeiro6430
    @andrewribeiro6430 ปีที่แล้ว +1

    Is there a way to test it using invoke lambda subcommand using CLI? (Without attaching a SNS or SQS trigger to Lambda)

    • @KnowledgeAmplifier1
      @KnowledgeAmplifier1  ปีที่แล้ว +1

      Hello Andrew Ribeiro, you can refer this -- docs.aws.amazon.com/cli/latest/reference/lambda/invoke.html Happy Learning