A line of tasks waiting for a worker, so users do not have to wait.
A message queue is a line of jobs. One part of the system (the producer) puts a message in the line. Another part (the consumer) takes it out later and does the work.
A message queue stores messages until a consumer is ready to process them. It works like a line at a ticket counter: the first message in is usually the first message out (FIFO).
Many workers read from the same queue. Each message goes to one worker. This shares the work.
| Topic | Simple meaning |
|---|---|
| Ack / nack | Ack = “done, delete it”. Nack = “I failed, try again or send elsewhere”. |
| Visibility timeout | While one worker holds a message, others cannot see it. If the worker dies, the message comes back after this time. |
| Ordering | Many queues are roughly first-in-first-out. With many consumers, the finish order can still differ. |
| Backpressure | When the queue grows too long, slow down producers or add consumers. |
| Durability | Messages are saved to disk (often copied to other machines), so a restart does not lose them. |
| Retention | How long unread messages are kept before the queue deletes them. |
| Term | Meaning in easy words |
|---|---|
| Producer | The part that creates and sends messages |
| Consumer / worker | The part that receives messages and does the work |
| Queue | A line that stores messages in order |
| Message | A small piece of data that describes a job or an event |
| Ack | A reply from the consumer saying the job is done |
| Nack | A reply saying the job failed |
| Visibility timeout | How long a received message is hidden from other consumers |
| FIFO | First in, first out |
| Queue depth | How many messages are waiting |
| Backpressure | Slowing down producers when consumers cannot keep up |
| Competing consumers | Many workers sharing one queue |
| Idempotent | Safe to run more than once with the same result |
| Choice | We gain | We lose |
|---|---|---|
| Async instead of sync | Speed for the user, resilience | No instant result, more complexity |
| Strict ordering | Predictable order | Less parallel work, lower throughput |
| Many consumers | More throughput | Order can change, more care needed |
| Long retention | Safe if consumers are down for long | More storage cost |