Reputation: 491
I am trying to set up DLQ to capture failed events from Lambda function.
Here is what I have done:
Now via 'Queue Actions', I can send a message and see it show up in "Messages Available". But if I send a http request to the lambda function - I purposely created a malformed JSON whose exception is not caught - I saw the error message in CloudWatch but nothing sent to QueueX.
What am I missing?
Upvotes: 3
Views: 4838
Reputation: 3097
According to your latest comment:
testing by posting a HTTP request from Postman directly to Api gateway for the lambda
This is the cause of the issue you are facing.
To explain, when you have an API gateway proxy to Lambda, API gateway handles the error cases that Lambda sends back (instead of the Lambda service itself, which has the DLQ configuration), and the errors will not end up in DLQ. In order to implement a DLQ, you need a different design, potentially something like calls going to SNS -> Lambda, and then on fail Lambda will send those messages to DLQ.
You might also be able to fix this if you don't have a proxy integration, but I haven't tested that out personally and I don't know for sure if this will work.
Upvotes: 3