Features of SQS
Explore the main features of Amazon Simple Queue Service (SQS) that support application integration. Understand short and long polling methods, how visibility timeout controls message processing, and the role of dead-letter queues in handling unprocessable messages. Learn about redrive policies to manage message retries and failures, enabling you to design more resilient distributed applications.
We'll cover the following...
Now that we have an understanding of SQS and the different types of queues we can create using this service, let’s look into the features it offers.
Polling
Polling is the process through which messages are received from a SQS queue. In this process, the consumers query the queue, whenever they are available, in order to receive messages from the queue. Amazon SQS supports short and long polling. These models provide different trade-offs in terms of latency, throughput, and cost, allowing us to choose the model that best fits our application’s requirements.
Short polling
In this method, only a subset of the servers are queried when the SQS queue receives a message retrieval request. SQS sends an empty response immediately, in case it doesn’t find any messages in the queue. Due to this, there is a chance we might not receive messages using short polling. However, if our queue contains less than 1000 messages, we’ll be able to receive these messages with short polling. Also, if we keep sending message retrieval requests to our queue, all available servers are queried to send back a response.
In the above diagram, only the S1, S3, and S5 servers are queried during short polling. Due to this, the message “d” is ...