2
votes

I have set up a dead letter queue in AWS Lambda configuration, to handle failed events. But when I tried sending an erroneous record (of size ~1KB), it is not getting sent to DLQ.

Below are the Steps I followed:-

  1. Sent invalid record from aws cli to kinesis stream.

  2. Lambda function polled the record from stream and tried processing. And it resulted into failure due to malformed input.

  3. Checked Lambda function cloud watch logs to confirm that processing has resulted into error.
  4. Checked dead letter errors number in Lambda's cloud watch log but it is still 0. Also verified DLQ through AWS Console, where available messages is still 0.

Configurations in AWS Lambda for asynchronous invocation:

  • Max age of event = 1 min,
  • Retry attempts = 1

Configuration of DLQ:

  • Delivery Delay: 0 seconds
  • Default Visibility Timeout: 30 seconds,
  • Maximum Message Size: 256 KB

Can someone explain what could be the possible reason for error messages not available in SQS?

Note : Lambda has required permissions to perform all operations on SQS. And there is no other consumer of SQS.

2
Please check this answer for understanding how to configure destination on failure in event source mapping: stackoverflow.com/a/63531865/8656417 - PodGen4

2 Answers

5
votes

Lambda reads data from Kinesis synchronously.
DLQ is used only for asynchronous invocations of Lambda.

0
votes

This all depends on the response you are returning from the function. If the response is a failure with proper error code it will definitely get pushed in DLQ. can you remove the DLQ configuration and then check if the message appearing in the SQS after the visibility time.