A Message Queue is middleware that enables asynchronous communication between applications. When a sender (Producer) sends a message to a queue, a receiver (Consumer) retrieves and processes the message at its own pace. This pattern removes temporal and spatial coupling between systems.
The core concepts are Producer (creates messages and sends them to the queue), Consumer (retrieves messages from the queue and processes them), Queue/Topic (the buffer where messages are stored), and Broker (the server responsible for message routing and delivery).
The message delivery guarantee levels are At-most-once (at most one time; messages may be lost), At-least-once (at least one time; duplicates are possible), and Exactly-once (exactly one time; the hardest). Most systems use At-least-once by default, and the Consumer side must ensure idempotency.
Comparison of major solutions: RabbitMQ is a traditional message broker that is strong in complex routing, Apache Kafka is a distributed event streaming platform suited to high-volume real-time processing, and AWS SQS is a fully managed service with no operational burden. Redis Streams is useful when a lightweight message queue is needed.
Message queues are used in various scenarios such as order processing, email sending, log collection, event sourcing, and integration between systems. In particular, in a microservices architecture, they are used as the core infrastructure for asynchronous communication between services.