An application processes messages from an Amazon SQS standard queue inside an Amazon ECS task. To process messages as cost-effectively as possible, which actions should the developer take? (Choose two.)
Choose an answer
Tap an option to check your answer.
Correct answer: Use long polling when querying the queue for messages., Retrieve messages in batches from the queue..
Why this is the answer
Long polling (up to 20 seconds) significantly reduces the number of empty responses received from SQS, which lowers the number of API calls and thus reduces costs. It also allows the message consumer to receive messages as soon as they are available. Retrieving messages in batches (up to 10 messages per request) reduces the number of API calls made to SQS, which directly translates to cost savings. Short polling increases the number of empty responses, leading to more API calls and higher costs. Caching messages in ElastiCache adds unnecessary complexity and cost, as SQS already provides reliable message storage. Switching to a FIFO queue is not relevant for cost optimization in this scenario; FIFO queues are for strict message ordering and exactly-once processing, which are different concerns.
Pass your exam — without the endless answer hunt
Get every verified question and explanation for this exam in one place, and save hours of prep. 1,000+ certifications · 20+ languages · free to start.
Pass your exam faster → No card needed