0

I have a FIFO Queue in the AWS SQS, which is trigger's Lambda function. I want to process each messages in Lambda function without parallel execution (one message at a time)

For example: If I have a message A, B, C in the queue. My lambda should complete A, then start B etc.,

My current config of the FIFO queue is

Message retention period: 4 Days
Default visibility timeout: 1 Hour 30 Minutes
Delivery delay: 0 sec
Receive message wait time: 0 Second
Ramesh Murugesan
  • 4,727
  • 7
  • 42
  • 67
  • 5
    Just make sure the lambda only has a batch size of 1 configured. Do all messages have the same message group id? If not: additionally limit the concurrency of your lambda to 1. – luk2302 Oct 13 '22 at 09:25
  • @luk2302 I fixed it with same message group ID and unique deduplication ID. Thanks for your support. Add your solution to the answer. – Ramesh Murugesan Oct 13 '22 at 09:37

1 Answers1

-1

set up another lamba(add/setup trigger to invoke this lamba for every one minute using Amazon event brige rule).
In the lamba funtion using receivemessage api call( https://docs.aws.amazon.com/AWSSimpleQueueService/latest/APIReference/API_ReceiveMessage.html) you can fetch desired number of messages from sqs queue (max 10 messages) and delete after processing each message.