+

Search Tips | Advanced Search

Messages and queues

Messages and queues are the basic components of a message queuing system.


What is a message?

A message is a string of bytes that is meaningful to the applications that use it. Messages are used to transfer information from one application program to another (or between different parts of the same application). The applications can be running on the same platform, or on different platforms.

An IBM MQ message is made up of:


Message lengths

The default maximum message length is 4 MB, although we can increase this to a maximum length of 100 MB (where 1 MB equals 1 048 576 bytes). In practice, the message length might be limited by:

It might take several messages to send all the information that an application requires.


How do applications send and receive messages?

Application programs send and receive messages using MQI calls.

For example, to put a message onto a queue, an application:
  1. Opens the required queue by issuing an MQI MQOPEN call
  2. Issues an MQI MQPUT call to put the message onto the queue

Another application can retrieve the message from the same queue by issuing an MQI MQGET call

For more information about MQI calls, see MQI calls.


What is a queue?

A queue is a data structure used to store messages.

Each queue is owned by a queue manager. The queue manager is responsible for maintaining the queues it owns, and for storing all the messages it receives onto the appropriate queues. The messages might be put on the queue by application programs, or by a queue manager as part of its normal operation.


Predefined queues and dynamic queues

Queues can be characterized by the way they are created:


Retrieving messages from queues

Suitably authorized applications can retrieve messages from a queue according to the following retrieval algorithms:

The MQGET request from the application determines the method used.