AWS Certified Developer – Associate — Question 26
A developer has discovered that an application responsible for processing messages in an Amazon SQS queue is routinely falling behind. The application is capable of processing multiple messages in one invocation, but is only receiving one message at a time.
What should the developer do to increase the number of messages the application receives?
Answer options
- A. Call the ChangeMessageVisibility API for the queue and set MaxNumberOfMessages to a value greater than the default of 1.
- B. Call the AddPermission API to set MaxNumberOfMessages for the ReceiveMessage action to a value greater than the default of 1.
- C. Call the ReceiveMessage API to set MaxNumberOfMessages to a value greater than the default of 1.
- D. Call the SetQueueAttributes API for the queue and set MaxNumberOfMessages to a value greater than the default of 1.
Correct answer: C
Explanation
The correct answer is C because the ReceiveMessage API allows the developer to specify how many messages to retrieve in a single call, thus increasing the throughput of message processing. Options A, B, and D do not directly influence the number of messages received in a single request, making them ineffective for this purpose.