Message Queue
A message queue is an asynchronous messaging component that stores messages from producing applications until consuming applications process them, decoupling services and smoothing bursts of work.
A message queue is a form of asynchronous communication in which a sending application places messages in a queue and one or more receiving applications retrieve and process them later. The queue stores messages durably until a consumer acknowledges successful processing, so producers and consumers do not need to be available at the same time or run at the same speed. Each message is typically processed by a single consumer, which distinguishes queues from publish-subscribe topics where every subscriber receives a copy.
Message queues decouple components in microservices and serverless architectures, buffer bursts of work, distribute tasks across worker pools and make systems resilient to temporary failures. Examples include RabbitMQ, Apache ActiveMQ, Amazon SQS and Azure Service Bus, and AMQP is a widely used open messaging protocol. Typical uses are order processing, image or document processing jobs and sending notifications.
Design considerations include delivery guarantees, since most queues provide at-least-once delivery and consumers must therefore be idempotent; ordering, which some queues guarantee only in special modes; visibility timeouts and retries; and dead-letter queues that hold messages that repeatedly fail. Queue depth and the age of the oldest message are key metrics and common triggers for scaling consumers automatically.
Key points
- Producers and consumers communicate asynchronously and need not run at the same time
- Each message is usually processed by one consumer, unlike publish-subscribe topics
- Examples include RabbitMQ, Apache ActiveMQ, Amazon SQS and Azure Service Bus
- Dead-letter queues capture messages that repeatedly fail processing
Where AiVibe comes in
AiVibe Software Services delivers cloud solutions on AWS, Microsoft Azure, Google Cloud or on-premise, together with cloud security, legacy modernisation, data analytics and AI and machine learning services.