Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

Lambda does not send message to SQS destination if invoked by an SQS source

I have the following set up:

SQS#1 -> Lambda -> SQS#2

I have a simple return in my Lambda function right now:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

async function handler(event) {
  return 'success';
}

If I invoke the lambda from the aws-cli using:

aws lambda invoke --function-name tt-yt-automation-production-1b2b-tiktok-download --invocation-type Event --cli-binary-format raw-in-base64-out /dev/null

It will return the message to the destination SQS (SQS#2), which will trigger another Lambda.

However, if SQS#1 has a message and invokes the Lambda, it does not send a message to SQS#2 and invokes the next Lambda in line.

My suspicion is that an SQS invocation doesn’t count as an asynchronous invocation and won’t send a message to SQS#2.

Is there a configuration I’m missing?

>Solution :

My suspicion is that an SQS invocation doesn’t count as an asynchronous invocation and won’t send a message to SQS#2.

You are correct. SQS invocation is synchronous. You have to "manually" (using AWS SDK) submit messages from your lambda to your SQS#2.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading