veda.ng
Back to Glossary

Message Queue

Message Queue infographic

A message queue is an asynchronous communication pattern where services send messages to a queue for later processing. Instead of Service A calling Service B directly and waiting for a response, Service A sends a message to a queue. Service B reads from the queue when it's ready. This decouples producers from consumers. Producers don't care when consumers process messages.

Consumers don't care when producers send messages. They just need to read from the same queue. This enables scalable, resilient systems. If a consumer is overloaded, messages pile up in the queue. When capacity increases, the consumer catches up. If a consumer crashes, messages wait in the queue until the consumer restarts. If a producer crashes, already-sent messages are safe in the queue.

RabbitMQ, Kafka, and AWS SQS are popular message queues. They differ in guarantees, some guarantee exactly-once delivery, some at-least-once. They differ in throughput and latency. But the concept is the same. Message queues are core to building scalable, event-driven architectures. They're how asynchronous systems work at scale.

Interactive Visualizer

Message Queue

Interactive demonstration of asynchronous message processing with producer-consumer decoupling

Producer (Service A)

Message Queue

Queue is empty
Queue Length: 0

Consumer (Service B)

Processed Messages
No messages processed yet

Key Benefits: Producers and consumers are decoupled - they operate independently. Messages are queued for processing when consumers are ready, enabling scalability and fault tolerance.