What is Message queue?

A message queue is a buffer that decouples producers from consumers, letting one part of a system hand off work asynchronously so the receiver can process it at its own pace, with retries and durability.

A message queue is an intermediary that holds messages between a producer that creates work and a consumer that processes it, decoupling the two in time and rate. Instead of calling a downstream service directly and waiting (and failing if it is slow or down), a producer drops a message onto the queue and moves on; one or more consumers pull messages and process them when they are ready. This buys several properties at once: load leveling (a traffic spike fills the queue rather than crushing the consumer), resilience (if a consumer crashes, the message stays in the queue until another picks it up), and elasticity (add consumers to drain a backlog faster). Queues underpin asynchronous and event-driven architectures and pair with dead-letter queues for poison messages, exponential backoff for retries, and idempotency so a redelivered message does no harm. They contrast with publish-subscribe, where each message fans out to many subscribers rather than being consumed once. Popular implementations include SQS, RabbitMQ, and the queue-like semantics of Kafka and Redis streams. For an AI agent that triggers background jobs or long-running tasks, understanding which work is queued versus synchronous, and the depth and latency of those queues, is operational context worth keeping in shared memory.