Popular Async Pattern SQS+ Lambda + DLQ (Dead Letter Queue) Python

แชร์
ฝัง
  • เผยแพร่เมื่อ 30 พ.ย. 2024

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

  • @patrickgeyer9239
    @patrickgeyer9239 ปีที่แล้ว +4

    Could you slow down and move the mouse only when necessary please

  • @harshaldaftary506
    @harshaldaftary506 2 ปีที่แล้ว +3

    Hey, great video! One query: when SQS triggers a lambda function, that is a SYNC call, correct? Then why are we modifying the "Asynchronous invocation" in the lambda func config? The retry mechanism and DLQ service in lambda are irrelevant and without doing that too, we can send our messages from lambda-queue->lambda_func->lambda-dlq

    • @SchoolScience
      @SchoolScience ปีที่แล้ว +2

      That's true. The retry that actually worked for him seems to be from the lambda-queue configuration. Without adding lambda-dlq as a DLQ for lambda-queue, it would not have worked.

    • @lamdevdaulung
      @lamdevdaulung ปีที่แล้ว

      I thought the Lambda polls SQS for messages periodically. It should be asynchronous.

    • @tiagorodrigues2298
      @tiagorodrigues2298 ปีที่แล้ว

      @@SchoolScience You are absolutely right. What is being displayed in the video is not wrong but, imo, misleading. The Lambda DLQ setup here is not needed. You can either do:
      1) Queue to DLQ setup
      This is essentially what the video shows. Create two queues, set one queue to be the DLQ, create a lambda trigger but DO NOT set a DLQ config in lambda. Post a message to the queue and check that it ends up in the DLQ
      2) Lambda to DLQ setup
      Create a queue and set the lambda DLQ config to be the queue you just created. Now invoke you lambda asynchronously (for example by creating another lambda that invokes your "DLQed" lambda with type "Event"). Notice that your "DLQed" lambda failed invocations now end up in your queue WITHOUT having to setup a second queue.
      Hope this helps whoever is struggling with this as I was

  • @sasiiqoobackup
    @sasiiqoobackup หลายเดือนก่อน

    Thank you Soumil😊

    • @SoumilShah
      @SoumilShah  หลายเดือนก่อน

      You’re welcome

  • @anil1970
    @anil1970 2 ปีที่แล้ว

    Great Video Soumil, straight to the point. I have a question. I am trying to use SNS FIFO --> SQS FIFO --> lambda function for processing. SNS and SQS are Content-based deduplication enabled. If i pass one record working fine but if i send multiple producer messages, one record being processed rest are being deleting. Any help?

    • @SoumilShah
      @SoumilShah  2 ปีที่แล้ว

      Can you explain more didn’t understand scenarios

    • @anil1970
      @anil1970 2 ปีที่แล้ว

      @@SoumilShah thanks for the response. In simple, SQS FIFO triggers lambda function. SQS sent 4 messages but lambda invoked twice. Concurrency is "Unreserved account concurrency & 1000". What can go wrong?

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

      @@anil1970 the reason lambda is invoked twice data is sent in batches in lambda lambda one got 2 records and lambda 2 got 2 records
      Also depends on if you are using king or short polling and what batch size window you are using !

    • @anil1970
      @anil1970 2 ปีที่แล้ว

      @@SoumilShah batch size was 10 and short polling. I changed batch size to 1. do you suggest anything more?

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

      @@anil1970 what is your ask do you want 10 messages is that what you want ? Increas delay in sqs queue
      Delay is time after which message appears in sqs

  • @ardavanmoinzadeh801
    @ardavanmoinzadeh801 2 ปีที่แล้ว

    Hey Soumil, Did you ever do the serverless framework for this topic? Instead of UI, maybe CDK?

    • @SoumilShah
      @SoumilShah  2 ปีที่แล้ว

      Yup there is video and lab I guess was lab 23 or 22 or 24 check out those I am sure I have one

  • @shishir2697
    @shishir2697 2 ปีที่แล้ว

    I have a question, if I don't want my entire batch to get rejected in case there is an error in specific record. Can I push those particular records to the DLQ using boto3 calls instead of configuring DLQ on lambda with retey counts which will eventually rejects the entire batch or it is not a good design practice?

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

      Yes but that would be issue
      The term used for that is poison messages
      Usually poison messages are better handelled in kinesis then dlq yes if you have try catch and if you just want to publish that message you can add that in catch blok )

    • @shishir2697
      @shishir2697 2 ปีที่แล้ว

      Gotcha, yes have implement it inside the try-catch block. Thanks for the reply

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

      @@shishir2697 anytime more than happy to talk more if you have Questions

  • @JC-kw4gx
    @JC-kw4gx 2 ปีที่แล้ว

    great video

  • @prasantkumarsrivastava5925
    @prasantkumarsrivastava5925 4 หลายเดือนก่อน

    yes, please slow down yourself in every respect pls