0

I have a lambda which processes messages from standard queue and that works fine. so, the execution role on lambda already has sqs permissions like receivemessage, getqueueattributes etc.

I have created a sqs fifo as I want this lambda to read messages from this sqs.I have added it as a trigger and I see sqs trigger on lambda side and lambda trigger on sqs enabled.

I see fifo sqs is receiving message and I see it in flight when I upload to s3 but I don't see it on lambda when it is from fifo queue. I am not understanding why this would happen as everything looks the same except that this is FIFO queue .

Any pointers on what might be going wrong as I see messages sent and inflight on fifo sqs ?

user2868864
  • 165
  • 2
  • 12
  • Typically, Lambda functions should **not** call SQS directly (eg `ReceveMessage()`). Instead, the SQS queue should be configured as a **trigger** on the Lambda function. This will automatically pass messages into the Lambda function when it is invoked, and the Lambda function does not need to call SQS and does not require any SQS permissions. What is _your_ Lambda function doing -- it is configured with a trigger, or is it calling SQS directly? – John Rotenstein Aug 09 '23 at 02:26
  • Yes, it is added as a trigger on the triggers section of lambda. so, I see it enabled. like i said the same works on standard queue but not this FIFO. – user2868864 Aug 09 '23 at 12:53
  • Can you confirm that you are receiving the messages via the incoming `event`, _without_ calling `ReceiveMessage`? I recommend that you debug the incoming messages by adding `print(event)` at the start of the Lambda function to see what messages are actually being received by the function. It might be that _multiple_ messages are being passed to the Lambda function. Also, are the messages being sent to the FIFO queue with the SAME MessageGroupId, or DIFFERENT MessageGroupId values? – John Rotenstein Aug 09 '23 at 12:59

0 Answers0