🔷

Amazon SQS – Long Polling

Long Polling allows a consumer to keep the connection open and wait for messages to arrive when the queue is empty, instead of returning immediately with no results. This reduces the number of empty responses and helps lower the cost by decreasing the total number of API requests. It also improves efficiency and responsiveness, as messages can be received as soon as they are available without the need for constant polling.
The wait time can be configured between 1 and 20 seconds (with 20 seconds being a common best practice). Long Polling can be enabled by default at the queue level or specified per request using the WaitTimeSeconds parameter in the API. Compared to short polling, it offers a more efficient and cost-effective way to retrieve messages from SQS.