message descriptor, message lengths, sending messages, MQI (message-queuing interface), receiving messages, application programs, sending and receiving" />
What is a message?
A message is a string of bytes that is meaningful to the applications that use it. Messages are used for transferring information from one application program to another (or to different parts of the same application). The applications can be running on the same platform, or on different platforms.
WebSphere MQ messages have two parts:
- The application data
The content and structure of the application data is defined by the application programs that use them.
- A message descriptor
The message descriptor identifies the message and contains additional control information such as the type of message, and the priority assigned to the message by the sending application.
The format of the message descriptor is defined by WebSphere MQ. For a complete description of the message descriptor, see the WebSphere MQ Application Programming Reference.
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 is limited by:
- The maximum message length defined for the receiving queue
- The maximum message length defined for the queue manager
- The maximum message length defined by the queue
- The maximum message length defined by either the sending or receiving application
- The amount of storage available for the message
It can 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:
- Opens the required queue by issuing an MQI MQOPEN call
- 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 the WebSphere MQ Application Programming Reference.