I have a simple lambda function that is triggered from a SQS queue and I'm using the new Lambda Destinations functionality.
It is set up to trigger from QUEUE_A
, do some modification of the payload body, then send it to QUEUE_B
on success, or QUEUE_ERRORS
on failure.
QUEUE_B
and QUEUE_ERRORS
are set up as Destinations on the lambda function.
When I trigger the lambda from the CLI, I get a record on QUEUE_B
with a good record, and on QUEUE_ERRORS
on a bad record. So, it seems to be working.
But, when the lambda is triggered from SQS, I never get a record on QUEUE_B
or QUEUE_ERRORS
. A good record runs the lambda, and on a bad record it goes to QUEUE_A_DEADLETTER
, which I do not want.
I have tried configuring QUEUE_A
to have no retry/deadletter - if I do that, on a bad record it will just retry forever (no matter how low I set the visibility/retries).
What can I try next?
EDIT:
CloudWatch shows me exactly what I expect to see - I see good logs on a "good" record, and stack traces/exceptions on "bad" records, so it is not a problem within the function itself AFAIK.
EDIT: Replacing the SQS triggers and destinations with SNS triggers and destinations are working. So, I think this is related to SQS being sync and SNS being async? Does anybody know?
SendMessage()
call succeeded. – LavernlavernaSendMessage()
defined? I am not trying to push to SQS in the function code, just as a Destination. I also expect a "bad" record to go toQUEUE_ERRORS
but it doesn't. – VinegaretteSendMessage()
. – Lavernlaverna