0
votes

We currently have a requirement of:

APIEndPoint ---> aws Lambda ------>aws SQS -----> Java_service

where APIEndPoint, Lambda & AWS_SQS are serverless functionality(new) that needs to be wired with existing Java_service (not a serverless functionality).

Lambda is a NodeJS runtime

SQS name is MyQueue(say)


Instead of Java_service(above), If it was another NodeJS lambda function(say sqsHandler),like:

APIendPoint ---> aws Lambda ------>aws SQS -----> aws Lambda 2

then the template would be:

functions:
   sqsHandlFunc:
     handler: handler.sqsHandler
     events:
       - sqs:
          arn:
             Fn:GetAtt:
                 - MyQueue
                 - Arn
             batchSize: 1

What should be the SAM template wiring, if the handler(sqsHandlFunc) is wiring awsSQS to a java service(non serverless)? java service(springboot app) is available through REST api

1

1 Answers

1
votes

You won't be able to set that up through a SAM template. You will instead need to make the Java service poll the SQS queue using the AWS Java SDK for SQS, specifically receiveMessage (see the receiveMessage section in this example)