+

Search Tips | Advanced Search

Types of message

There are four types of messages defined by IBM MQ .

These four messages are:

Applications can use the first three types of messages to pass information between themselves. The fourth type, report, is for applications and queue managers to use to report information about events such as the occurrence of an error.

Each type of message is identified by an MQMT_* value. We can also define your own types of message. For the range of values we can use, see MsgType.


Datagrams

Use a datagram when we do not require a reply from the application that receives the message (that is, gets the message from the queue).

An example of an application that might use datagrams is one that displays flight information in an airport lounge. A message might contain the data for a whole screen of flight information. Such an application is unlikely to request an acknowledgment for a message because it probably does not matter if a message is not delivered. The application sends an update message after a short time.


Request messages

Use a request message when you want a reply from the application that receives the message.

An example of an application that could use request messages is one that displays the balance of a checking account. The request message could contain the number of the account, and the reply message would contain the account balance.

If you want to link your reply message with your request message, there are two options:


Reply messages

Use a reply message when you reply to another message.

When you create a reply message, respect any options that were set in the message descriptor of the message to which you are replying. Report options specify the content of the message identifier (MsgId) and correlation identifier (CorrelId) fields. These fields allow the application that receives the reply to correlate the reply with its original request.


Report messages

Report messages inform applications about events such as the occurrence of an error when processing a message.

They can be generated by:

Report messages can be generated at any time, and might arrive on a queue when our application is not expecting them.