Simple Queue Service (SQS) CheatSheet
-
SQS is a queuing service using messages with a queue. Think Sidekiq or RabbitMQ
-
SQS is used for Application Integration, it lets decoupled services and apps to talk to each other
-
To read SQS use need to pull the queue using the AWS SDK. SQS is not pushed-based
-
SQS supports both Standard and First-In-First-Out (FIFO) queues
-
Standard allows nearly unlimited messages per second, does not guarantee order of delivery, always delivers at least once, you must protect again duplicate messages being processed
-
FIFO maintain the order of messages with a 300 limit
-
There are two kinds of polling Short (Default) and Long Polling
-
Short polling returns messages immediately, even if the message queue being polled is empty.
-
Long polling waits until message arrives in the queue, or the long poll timeout expires.
-
In majority of cases Long polling is preferred over short polling.
-
Visibility time-out is the period of time that messages are invisible in the SQS queue
-
Messages will be deleted from queue after a job has processed. (before visibility timeout expires)
-
If Visibility timeout expires than a job will become visible to the queue
-
The default Visibility time-out is 30 seconds. Timeout can be O seconds to a maximum of 12 hours.
-
SQS can retain messages from 60 seconds to 14 days and by default is 4 days
-
Message size between 1 byte to 256 kb, Extended Client Library for Java can increase to 2GB