Which solution will meet these requirements?
Set the event source mapping batch size to 10 for the high priority queue and to 90 for the low priority queue.
Set the delivery delay to 0 seconds for the high priority queue and to 10 seconds for the low priority queue.
Set the event source mapping maximum concurrency to 10 for the high priority queue and to 90 for the low priority queue.
Set the event source mapping batch window to 10 for the high priority queue and to 90 for the low priority queue.
Explanations:
Setting the batch size to 10 for the high priority queue allows the Lambda function to read up to 10 messages at a time, but the low priority queue’s batch size of 90 could lead to a situation where the Lambda function starts processing messages from the low priority queue before finishing the high priority messages, violating the requirement.
Setting a delivery delay does not prioritize the high priority queue over the low priority queue. Both queues will still be processed based on their respective message availability and Lambda’s concurrency limits, which does not ensure that the high priority messages are always processed first.
By setting the maximum concurrency to 10 for the high priority queue, the Lambda function can process up to 10 messages simultaneously from this queue. With the remaining concurrency of 90, the function can then process messages from the low priority queue, ensuring the high priority messages are always read first.
Setting a batch window does not influence the priority of message processing between the two queues. It only controls how long the event source mapping should wait before sending messages to the Lambda function, which does not address the requirement of prioritizing high priority messages.