I have a lambda that queries a database and sends each record to SQS. That lambda is set to run with cron(...)
and http
for manual testing. I created a sqs.fifo queue in the console and I can see traffic in there. I created a second lambda that subscribe to the sqs.fifo queue. They way I created the trigger was by adding the event in the index.ts
file of that second lambda like so:
export default {
handler: 'path/to/handler.main`
events: [
{
sqs: {
arn: 'arn:aws.my-queue.fifo',
batchSize: 1
}
}
]
}
After deploying I can go in the console to the sqs.fifo
and see that indeed the queue has a Lambda trigger setup as intended.
I manually changed the cron(...)
in the console to run every 5 minutes so I can test the workflow. What is happening is that the second lambda never gets invoked. I can see in CloudWatch that the first lambda is sending messages with respective content/body/payload every 5 minutes but the second lambda has no movement in CloudWatch and there 0 emails getting sent.
Interestingly, if I trigger 2 times the first lambda with the http
event with postman, an email gets send only one time. I’m not sure what is wrong in the setup. Any help its appreciated.