All Topics  
Message queue

 

   Email Print
   Bookmark   Link






 

Message queue



 
 
In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, a message queue is a software-engineering
Software engineering

Software engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches....
 component used for interprocess communication or inter-thread
Thread (computer science)

In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
 communication within the same process. It uses a queue for messaging – the passing of control or of content. Group communication system
Group communication system

The term Group Communication System refers to a software platform that implements some form of group communication. Examples of group communication systems include IS-IS, JGroups, Spread Toolkit, Appia framework, QuickSilver , and the group services component of IBM's RSCT....
s provide similar kinds of functionality.

age queues provide an asynchronous
Asynchronous communication

In telecommunications, Asynchronous communication is transmission of data without the use of an external clock signal. Any timing required to recover data from the communication symbols is encoded within the symbols....
 communications protocol
Communications protocol

In the field of telecommunications, a communications protocol is the set of standard rules for data representation, Signalling , authentication and Error detection and correction required to send information over a communications channel....
, meaning that the sender and receiver of the message do not need to interact with the message queue at the same time.






Discussion
Ask a question about 'Message queue'
Start a new discussion about 'Message queue'
Answer questions from other users
Full Discussion Forum



Encyclopedia


In computer science
Computer science

Computer science is the study of the theoretical foundations of information and computation, and of practical techniques for their implementation and application in computer systems....
, a message queue is a software-engineering
Software engineering

Software engineering is the application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software, and the study of these approaches....
 component used for interprocess communication or inter-thread
Thread (computer science)

In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
 communication within the same process. It uses a queue for messaging – the passing of control or of content. Group communication system
Group communication system

The term Group Communication System refers to a software platform that implements some form of group communication. Examples of group communication systems include IS-IS, JGroups, Spread Toolkit, Appia framework, QuickSilver , and the group services component of IBM's RSCT....
s provide similar kinds of functionality.

Overview

Message queues provide an asynchronous
Asynchronous communication

In telecommunications, Asynchronous communication is transmission of data without the use of an external clock signal. Any timing required to recover data from the communication symbols is encoded within the symbols....
 communications protocol
Communications protocol

In the field of telecommunications, a communications protocol is the set of standard rules for data representation, Signalling , authentication and Error detection and correction required to send information over a communications channel....
, meaning that the sender and receiver of the message 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.

Most message queues have set limits on the size of data that can be transmitted in a single message. Those that do not have such limits are known as mailboxes.

Many implementations of message queues function internally: within an operating system
Operating system

An operating system is an interface between hardware and applications; it is responsible for the management and coordination of activities and the sharing of the limited resources of the computer....
 or within an application
Application software

Application software is any tool that functions and is operated by means of a computer, with the purpose of supporting or improving the software user 's work....
. Such queues exist for the purposes of that system
System

System is a set of interacting or interdependent entities, real or abstract, forming an integrated whole.The concept of an "integrated whole" can also be stated in terms of a system embodying a set of relationships which are differentiated from relationships of the set to other elements, and from relationships between an element of the se...
 only.

Other implementations allow the passing of messages between different computer systems, potentially connecting multiple applications and multiple operating systems. These message queueing systems typically provide enhanced resilience
Resilience (network)

In computer networking: ?Resilience is the ability to provide and maintain an acceptable level of Service in the face of Fault and challenges to normal operation.?...
 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 queueing software (also known as Message Oriented Middleware) include IBM
IBM

International Business Machines Corporation, abbreviated IBM and nicknamed "Big Blue" , is a multinational corporation computer technology and consulting corporation headquartered in Armonk, New York, New York, United States....
's WebSphere MQ
WebSphere MQ

IBM WebSphere MQ is a family of computer network communication software products launched by IBM in March 1992. It was previously known as MQSeries, a trademark that IBM rebranded in 2002 to join the suite of WebSphere products....
 (formerly MQ Series), Oracle Advanced Queuing
Oracle Advanced Queuing

In computing, Oracle Advanced Queuing comprises a species of Message Oriented Middleware developed by Oracle Corporation and integrated into its Oracle database....
 (AQ) within an Oracle database
Oracle database

The Oracle Database consists of a relational database management system produced and marketed by Oracle Corporation. , Oracle had become a major presence in database computing....
, and Microsoft
Microsoft

Microsoft Corporation is a multinational corporation computer technology corporation that develops, manufactures, licenses, and supports a wide range of computer software products for computing devices....
's MSMQ
Microsoft Message Queuing

Microsoft Message Queuing or MSMQ is a Message Queue implementation developed by Microsoft and deployed in its Microsoft Windows Server operating systems since Windows NT 4 and Windows 95....
. There is a Java
Java (programming language)

Java is a programming language originally developed by James Gosling at Sun Microsystems and released in 1995 as a core component of Sun Microsystems' Java ....
 standard called Java Message Service
Java Message Service

The Java Message Service Application Programming Interface is a Java Message Oriented Middleware API for sending messages between two or more Client ....
, which has, associated with it, a number of implementations, both proprietary
Proprietary software

Proprietary software is a term coined by advocates of the free software movement to describe computer software which is the legal property of one party....
 and free software
Free software

Free Software or software libre is software that can be used, studied, and modified without restriction, and which can be copied and redistributed in modified or unmodified form either without restriction, or with minimal restrictions only to ensure that further recipients can also do these things and to prevent consumer-facing hardware...
.

There are a number of open source choices of messaging middleware systems, including JBoss Messaging
JBoss Messaging

JBoss Messaging is the new JBoss enterprise asynchronous messaging system. It supersedes JBoss MQ as the default Java Message Service provider in JBoss AS 5 ....
, , ActiveMQ, (an implementation, in Erlang, of AMQP
Advanced Message Queuing Protocol

The Advanced Message Queuing Protocol is an open standard application layer protocol for Message Oriented Middleware. The defining features of AMQP are message orientation, queuing, routing , reliability and security ....
), , (runs atop PostgreSQL
PostgreSQL

PostgreSQL is an object-relational database management system . It is released under a BSD licenses and is thus free software. As with many other open-source programs, PostgreSQL is not controlled by any single company, but has a global community of developers and companies to develop it....
, created by Skype
Skype

Skype is software that allows users to make voice over Internet Protocol. Calls to other users of the service and to free-of-charge numbers are free, while calls to other landlines and mobile phones can be made for a fee....
).

In addition to open source systems, hardware-based messaging middleware is a growing trend with vendors like Solace Systems
Solace systems

Solace Systems is a content networking company based in Kanata, Ontario, Canada that manufactures and sells content routers. Content routers are rack-mountable network devices that implements publish-subscribe message-oriented middleware and content-based routing....
, Sonoa and Tervela offering queuing through silicon or silicon/software datapaths.

Most RTOSes, such as VxWorks
VxWorks

VxWorks is a real-time operating system operating system made and sold by Wind River Systems of Alameda, California, California, USA.VxWorks is designed for use in embedded systems....
 and QNX
QNX

QNX is a commercial Unix-like real-time operating system, aimed primarily at the embedded systems market. On September 12, 2007, the source of the QNX kernel was released for non-commercial use....
 operating systems encourage the use of message queueing as the primary IPC or inter-thread
Thread (computer science)

In computer science, a thread of execution is a Fork of a computer program into two or more Concurrency running task s. The implementation of threads and process es differs from one operating system to another, but in most cases, a thread is contained inside a process....
 communication mechanism. The resulting tight integration between message passing and CPU scheduling is attributed as a main reason for the usability of RTOSes for real time applications. Early examples of commercial RTOSes that encouraged a message-queue basis to inter-thread communication also include VRTX
Versatile Real-Time Executive

Versatile Real-Time Executive is a real-time operating system nowadays developed and marketed by the company Mentor Graphics. VRTX is suitable for both traditional board-based embedded systems and System-on-a-chip architectures....
 and pSOS
PSOS

According to some industry insiders, pSOS stands for plug-in Silicon Operating System but the official stance is that it is not an abbreviation, just a made-up word....
+, both of which date to the early 1980s.

Usage

In a typical message-queueing implementation, a system administrator
System administrator

A system administrator, systems administrator, or sysadmin, is a person employed to maintain and operate a computer system and/or computer network....
 installs and configures off-the-shelf message-queueing software (a queue manager), and defines a named message queue.

An application then registers a software routine that "listens" for messages placed onto the queue.

Second and subsequent applications may connect to the queue and transfer a message onto it.

The queue-manager software stores the messages until a receiving application connects and then calls the registered software routine. The receiving application then processes the message in an appropriate manner...

There are often numerous options as to the exact semantics of message passing, including:

  • Durability (e.g. - whether or not queued data can be merely kept in memory, or if it mustn't be lost, and thus must be stored on disk, or, more expensive still, it must be committed more reliably to a DBMS)


  • Security policies


  • Message purging policies - queues or messages may have a TTL (Time To Live)


  • Some systems support filtering data so that a subscriber may only see messages matching some pre-specified criteria of interest


  • Delivery policies - do we need to guarantee that a message is delivered at least once, or no more than once?


  • Routing policies - in a system with many queue servers, what servers should receive a message or a queue's messages?


  • Batching policies - should messages be delivered immediately? Or should the system wait a bit and try to deliver many messages at once?


  • When should a message be considered "enqueued"? When one queue has it? Or when it has been forwarded to at least one remote queue? Or to all queues?


  • A publisher may need to know when some or all subscribers have received a message.


These are all considerations that can have substantial effects on transaction semantics, system reliability, and system efficiency.

Synchronous vs. asynchronous

Many of the more widely-known communications protocol
Communications protocol

In the field of telecommunications, a communications protocol is the set of standard rules for data representation, Signalling , authentication and Error detection and correction required to send information over a communications channel....
s in use operate synchronously. The HTTP protocol – used in the World Wide Web
World Wide Web

The World Wide Web is a very large set of interlinked hypertext documents accessed via the Internet. With a Web browser, one can view Web pages that may contain writing, s, videos, and other multimedia and navigate between them using hyperlinks....
 and in web services – offers an obvious example.

In a synchronous model, one system makes a connection to another, sends a request and waits for a reply.

In many situations this makes perfect sense; for example, a user sends a request for a web page and then waits for a reply.

However, other scenarios exist in which such behaviour is not appropriate. For example, an application may need to notify another that an event has occurred, but does not need to wait for a response. Another example occurs in publish/subscribe
Publish/subscribe

Publish/subscribe is an asynchronous messaging paradigm where senders of messages are not programmed to send their messages to specific receivers ....
 systems, where an application "publishes" information for any number of clients to read. In both these examples it would not make sense for the sender of the information to have to wait if, for example, one of the recipients had crashed.

Alternatively, an interactive application may need to respond to certain parts of a request immediately (such as telling a customer that a sales request has been accepted, and handling the promise to draw on inventory), but may queue other parts (such as completing calculation of billing, forwarding data to the central accounting system, and calling on all sorts of other services) to be done some time later.

In all these sorts of situations, having a subsystem which does asynchronous message-queuing (or alternatively, a broadcast messaging system) can help improve the behaviour of the overall system. Some more detail regarding the Message Queue structure can be found at the MSDN site.

External links


  • - a simple MQ system implemented in Perl
    Perl

    In computer programming, Perl is a high-level programming language, List of programming languages by category, Interpreter , dynamic programming language....
     that provides a simple set of XML-RPC
    XML-RPC

    XML-RPC is a remote procedure call protocol which uses XML to encode its calls and [] as a transport mechanism. ...
     methods to offer asynchronous messaging
  • - factors to take into consideration when deciding if/where to use durable messaging