AWS Certified Developer – Associate / Question #1083 of 557

Question #1083

An application is designed to consume messages from an Amazon SQS standard queue using AWS Fargate tasks in Amazon ECS. The development team wants to optimize the solution for cost-effectiveness while ensuring efficient message processing.

Which two actions should be taken to achieve this goal? (Choose two.)

A

Configure the SQS queue to use long polling when retrieving messages.

B

Set the SQS queue to use short polling for faster message retrieval.

C

Retrieve messages in batches using the maximum number of messages per API call.

D

Implement an Amazon ElastiCache cluster to store messages temporarily.

E

Use an SQS FIFO queue to ensure messages are processed exactly once.

Explanation

Long polling (A) reduces the number of empty responses by waiting for messages, lowering API costs. Retrieving messages in batches (C) minimizes API calls (up to 10 messages per call), improving efficiency and cost-effectiveness.

B (short polling) increases costs due to frequent empty responses. D (ElastiCache) adds unnecessary complexity and cost since SQS already stores messages. E (FIFO queue) is not required here; standard queues are more cost-effective unless strict ordering/exactly-once processing is needed.

Key Points:
1. Long polling reduces API costs by avoiding empty responses.
2. Batch processing reduces API calls.
3. Standard queues are cheaper than FIFO unless specific features are required.

Answer

The correct answer is: {A,C}