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

Getting lambda response when calling lambda through SQS

I have the following pipeline:

Script –> SQS –> Lambda

  • A script sends a message to a SQS queue.
  • Based on the content of this message, the Lambda executes a different process (Calls an API with some payload)
  • The script needs to receive the API HTTP response, output of Lambda.

How can I achieve this last step? (Ideally using boto3)

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

>Solution :

You can’t / don’t. If you want a response from the lambda invoke the lambda directly and synchronously. Putting a queue between you and the lambda explicitly decouples your script from the lambda.

You could include some path / identifier in the message which tells the lambda where to put the response, e.g. under what dynamodb entry or into which S3 key. And then your script would need to poll that target location for an update from the lambda.

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