nerdexam
Amazon

DVA-C02 · Question #540

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 Co

The correct answer is A. Use long polling to query the queue for new messages. C. Use message batching to retrieve messages from the queue.. Long polling and message batching together minimize SQS API call costs by reducing empty responses and retrieving multiple messages per request.

Submitted by tom_us· Mar 5, 2026Development with AWS Services

Question

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.)

Options

  • AUse long polling to query the queue for new messages.
  • BUse short polling to query the queue for new messages.
  • CUse message batching to retrieve messages from the queue.
  • DUse Amazon ElastiCache to cache messages in the queue.
  • EUse an SQS FIFO queue to manage the messages.

How the community answered

(27 responses)
  • A
    70% (19)
  • B
    4% (1)
  • D
    11% (3)
  • E
    15% (4)

Why each option

Long polling and message batching together minimize SQS API call costs by reducing empty responses and retrieving multiple messages per request.

AUse long polling to query the queue for new messages.Correct

Long polling (WaitTimeSeconds up to 20 seconds) causes the SQS ReceiveMessage call to wait for messages to arrive before returning, eliminating empty responses that count as billable API calls and reducing unnecessary polling frequency.

BUse short polling to query the queue for new messages.

Short polling returns immediately even when the queue is empty, generating frequent billable API calls with no messages, making it the most expensive polling strategy.

CUse message batching to retrieve messages from the queue.Correct

Batch retrieval (up to 10 messages per ReceiveMessage call) reduces the total number of API requests needed to process a given volume of messages, directly lowering SQS API call costs.

DUse Amazon ElastiCache to cache messages in the queue.

ElastiCache is an in-memory caching service and cannot store or retrieve SQS messages; SQS messages are only accessible through SQS APIs.

EUse an SQS FIFO queue to manage the messages.

SQS FIFO queues provide ordering and deduplication guarantees but cost more per API call than standard queues and do not reduce the number of API calls made.

Concept tested: SQS long polling and batch retrieval cost optimization

Source: https://docs.aws.amazon.com/AWSSimpleQueueService/latest/SQSDeveloperGuide/sqs-short-and-long-polling.html

Community Discussion

No community discussion yet for this question.

Full DVA-C02 Practice