Reputation: 309
I have a lambda function configured for receiving eventes whenever a file is dropped to my s3 bucket.
My requirement is to configure a dead letter queue for lambda function, so that any failure happened, event should go to dlq.
My question is that, what response should be given from lambda function, so that it will push event to dlq?
Eg scenario: I have an event validator module within lambda, if validation fails, i wanted to move it to dlq configured for my lambda function.
Upvotes: 3
Views: 318
Reputation: 5102
Just throw an exception and make sure your function is idempotent:
Any Lambda function invoked asynchronously is retried twice before the event is discarded
See Dead Letter Queues in AWS Lambda Developer Guide.
Upvotes: 2