1
votes

I am using Lambda function to push message to SQS queue. Once the message is placed in SQS queue i need to trigger other Lambda function to process the message in Queue.

I think this we can implement using SNS. I am new in AWS service, Please suggest solution to trigger Lambda function based on SQS queue messages with the help of SNS.

2
You can omit SNS step - cloudonaut.io/…Vlad Holubiev
Thanks for your reply @Vlad I am looking real time queue processing . your suggested approach will work for real time processing .Team

2 Answers

0
votes

You don't need the SNS layer in between. From your first Lambda do 2 things

  1. Place a message in SQS and
  2. Trigger the Lambda that will process the event

Out of curiosity, why do you need to put the message to SQS. If your processing is trivial then you can straightaway process the message in your first lambda function itself.

This way you save the cost of SQS as well as of other Lambda

0
votes

I think that will depend on the urgency of processing messages. If you want to process all the messages in Realtime then send them to SNS and subscribe your Lambda to that Topic.

Another scenario can be where you are processing your messages in realtime and any failure frequently occurs due to some dependency, then in those case send it to SQS and process through a Lambda Polling later.

Lambdas triggering is pretty flexible in all these cases, you can directly subscribe your lambda to SNS topic to process, Also you can schedule your lambda to run it on cron basis(useful in case of polling and processing SQS messages)