AWS Certified Developer – Associate (DVA-C02) — Question 468
A developer is building an application that will process messages from an Amazon Simple Queue Service (Amazon SQS) standard queue. The application needs to process the messages in an Amazon Elastic Container Service (Amazon ECS) task.
Which actions will result in the MOST cost-effective processing of the messages? (Choose two.)
Answer options
- A. Use long polling to query the queue for new messages.
- B. Use short polling to query the queue for new messages.
- C. Use message batching to retrieve messages from the queue.
- D. Use Amazon ElastiCache to cache messages in the queue.
- E. Use an SQS FIFO queue to manage the messages.
Correct answer: A, C
Explanation
Long polling reduces costs by waiting for messages to arrive before returning a response, which significantly cuts down on empty receive requests. Message batching allows the application to retrieve up to 10 messages in a single API call, reducing the overall number of API requests and lowering transaction costs. Short polling increases empty responses and SQS costs, while ElastiCache and FIFO queues introduce unnecessary expenses for this basic optimization scenario.