- The side that creates work (your site when a customer orders, say) sends a message. It is stored on several machines before the answer, and your site can reply at once.
- A worker receives the message. It is hidden from others for the visibility timeout, and the worker gets a
receiptfor this receive. With no message waiting, a receive can wait up to 20 seconds (long polling). - When the job is done, the worker deletes the message with its
receiptand it leaves the queue. - If the worker fails, or does not delete within the visibility timeout, the message comes back for another worker, and its receive count goes up.
- With a maximum receives set, a message received more often than that moves to a dead-letter queue for you to inspect instead of looping forever.
Each queue’s settings
| Setting | Default | Range |
|---|---|---|
| Visibility timeout | 30 seconds | 0 seconds – 12 hours (workers can change it per message) |
| Keep messages for | 4 days | 1 minute – 14 days |
| Delay | 0 | 0 – 15 minutes (or per message) |
| Maximum receives | 0 (no limit) | 0 – 1,000, then moved to the dead-letter queue or dropped |
Messages are delivered at least once. Rarely (a machine failing during a receive, say) the same message is delivered twice, so make jobs safe to repeat, for example by checking the order number before taking stock. Older messages come first, but the order is not guaranteed.
You pay per request (sends, receives, deletes and the rest; every 64 KB of a message counts as one request) for the message data you receive, and for messages left waiting in a queue (by size and time; a queue whose workers keep up pays next to nothing for it). There is no monthly minimum. See the pricing page for current prices.