Does AWS SQS long polling wait for a message to be available in the queue before sending a response?

Disable ads (and more) with a premium pass for a one time $4.99 payment

Study for the AWS Certified Developer Associate Exam with flashcards and multiple choice questions. Each question offers hints and explanations. Get ready to enhance your cloud development skills and pass your certification exam!

AWS SQS long polling does indeed wait for messages to be available in the queue before sending a response. This feature allows for a more efficient use of resources because it reduces the number of empty responses that are returned when no messages are present. With long polling, if no messages are immediately available, the request can wait for a specified duration—up to 20 seconds—before it returns a response. If messages arrive during that wait time, they are sent back to the requester in the response.

This behavior contrasts with short polling, where the request returns immediately, whether messages are present or not, which can lead to higher costs and more calls to the API. Therefore, long polling is preferred when trying to minimize application latency and reduce unnecessary costs associated with frequent polling of the queue.

The other choices suggest scenarios where long polling either does not wait or has conditional behavior, which does not accurately represent the purpose of long polling in SQS.

Subscribe

Get the latest from Examzify

You can unsubscribe at any time. Read our privacy policy