AWS Certified Developer – Associate / Question #847 of 557

Question #847

A company uses an AWS Lambda function configured with an Amazon SQS queue named 'urgentqueue' as an event source. The developer needs to add another SQS queue named 'standardqueue' as an additional event source. The Lambda function must prioritize processing up to 20 simultaneous messages from the 'urgentqueue' before handling messages from the 'standardqueue'. The total concurrent Lambda invocations must not exceed 200.

Which solution will meet these requirements?

A

Set the event source mapping batch size to 20 for the 'urgentqueue' and to 180 for the 'standardqueue'.

B

Set the delivery delay to 0 seconds for the 'urgentqueue' and to 20 seconds for the 'standardqueue'.

C

Set the event source mapping maximum concurrency to 20 for the 'urgentqueue' and to 180 for the 'standardqueue'.

D

Set the event source mapping batch window to 20 for the 'urgentqueue' and to 180 for the 'standardqueue'.

Explanation

The solution uses AWS Lambda's event source mapping maximum concurrency feature, which allows per-queue concurrency limits. Setting 'urgentqueue' to 20 ensures Lambda processes up to 20 messages from it first. The remaining 180 concurrency (200 total - 20 urgent) is allocated to 'standardqueue'. This guarantees prioritization while adhering to the total concurrency cap.

Why other options are incorrect:
- A: Batch size controls messages per poll, not concurrency. It does not prioritize queues.
- B: Delivery delay delays message availability but does not enforce concurrency limits or prioritization.
- D: Batch window controls how long Lambda waits to aggregate messages, not concurrency.

Key Points:
- Use Maximum Concurrency in event source mappings to control Lambda concurrency per SQS queue.
- Total concurrent executions across all event sources must not exceed Lambda's account/function limit (200 here).
- Prioritization is achieved by reserving concurrency for high-priority queues first.

Answer

The correct answer is: C