Lably
Skip to content

Message queue

  • 8 min read
  • 6 chapters

Related on Lably

Through Computer science, Message and Operating system

The message queue paradigm is a sibling of the publisher/subscriber pattern, and is typically one part of a larger message-oriented middleware system. Most messaging systems support both the publisher/subscriber and message queue models in their API, e.g. Java Message Service (JMS).

Competing Consumers pattern enables multiple concurrent consumers to process messages on the same message queue.

Remit and ownership

Message queues implement an asynchronous communication pattern between two or more processes/threads whereby the sending and receiving party do not need to interact with the message queue at the same time. Messages placed onto the queue are stored until the recipient retrieves them. Message queues have implicit or explicit limits on the size of data that may be transmitted in a single message and the number of messages that may remain outstanding on the queue.

Remit

Many implementations of message queues function internally within an operating system or within an application. Such queues exist for the purposes of that system only.

Other implementations allow the passing of messages between different computer systems, potentially connecting multiple applications and multiple operating systems. These message queuing systems typically provide resilience functionality to ensure that messages do not get "lost" in the event of a system failure. Examples of commercial implementations of this kind of message queuing software (also known as message-oriented middleware) include IBM MQ (formerly MQ Series) and Oracle Advanced Queuing (AQ). There is a Java standard called Java Message Service, which has several proprietary and free software implementations.

Real-time operating systems (RTOSes) such as VxWorks and QNX encourage the use of message queuing as the primary inter-process or inter-thread communication mechanism. This can result in integration between message passing and CPU scheduling. Early examples of commercial RTOSes that encouraged a message-queue basis to inter-thread communication also include VRTX and pSOS+, both of which date to the early 1980s. The Erlang programming language uses processes to provide concurrency; these processes communicate asynchronously using message queuing.

Ownership

The message queue software can be either proprietary, open source or a mix of both. It is then run either on premise in private servers or on external cloud servers (message queuing service).

  • Proprietary options have the longest history, and include products from the inception of message queuing, such as IBM MQ, and those tied to specific operating systems, such as Microsoft Message Queuing (MSMQ). Cloud service providers also provide their proprietary solutions such as Amazon Simple Queue Service (SQS), StormMQ, Solace, and IBM MQ.
  • Open source choices of messaging middleware systems includes Apache ActiveMQ, Apache Kafka, Apache Qpid, Apache RocketMQ, Enduro/X, JBoss Messaging, JORAM, RabbitMQ, Sun Open Message Queue, and Tarantool.

Examples on hardware-based messaging middleware vendors are Solace, Apigee, and IBM MQ.

Sign in to keep reading

5 more chapters are free with a Lably account.

More in Computing and communication