How Queue Service works: send, receive, delete

Every message goes through three steps, and none is lost even when a worker fails mid-job.

  1. 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.
  2. A worker receives the message. It is hidden from others for the visibility timeout, and the worker gets a receipt for this receive. With no message waiting, a receive can wait up to 20 seconds (long polling).
  3. When the job is done, the worker deletes the message with its receipt and it leaves the queue.
  4. 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.
  5. 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

SettingDefaultRange
Visibility timeout30 seconds0 seconds – 12 hours (workers can change it per message)
Keep messages for4 days1 minute – 14 days
Delay00 – 15 minutes (or per message)
Maximum receives0 (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.

Still stuck? Let our team help

Open a ticket from the Console. Tell us the site or service, what you did and the message on screen. Our reply comes back in the same ticket, so everything stays in one place.