Message groups

 

Segmentation is not supported on WebSphere MQ for z/OS.

Messages can occur within groups. This allows ordering of messages (see Logical and physical ordering), and, except on WebSphere MQ for z/OS, segmentation of large messages (see Message segmentation) within the same group.

The hierarchy within a group is as follows:

Group

This is the highest level in the hierarchy and is identified by a GroupId. It consists of one or more messages that contain the same GroupId. These messages can be stored anywhere on the queue.

The term message is used here to denote one item on a queue, such as would be returned by a single MQGET that does not specify MQGMO_COMPLETE_MSG.

Figure 1 shows a group of logical messages:

Figure 1. Group of logical messages

Logical message

Logical messages within a group are identified by the GroupId and MsgSeqNumber fields. The MsgSeqNumber starts at 1 for the first message within a group, and if a message is not in a group, the value of the field is 1.

Use logical messages within a group to:

  • Ensure ordering (if this is not guaranteed under the circumstances in which the message is transmitted).

  • Allow applications to group together similar messages (for example, those that must all be processed by the same server instance).

Each message within a group consists of one physical message, unless it is split into segments. Each message is logically a separate message, and only the GroupId and MsgSeqNumber fields in the MQMD need bear any relationship to other messages in the group. Other fields in the MQMD are independent; some might be identical for all messages in the group whereas others might be different. For example, messages in a group can have different format names, CCSIDs, encodings, and so on.

Segment

Segments are used to handle messages that are too large for either the putting or getting application or the queue manager (including intervening queue managers through which the message passes). For more information about this, see Message segmentation.

A segment of a message is identified by the GroupId, MsgSeqNumber, and Offset fields. The Offset field starts at zero for the first segment within a message.

Each segment consists of one physical message that might belong to a group (Figure 2 shows an example of messages within a group). A segment is logically part of a single message, so only the MsgId, Offset, and SegmentFlag fields in the MQMD should differ between separate segments of the same message.

Figure 2 shows a group of logical messages, some of which are segmented:

Figure 2. Segmented messages

For a description of logical and physical messages, see Logical and physical ordering. For further information about segmenting messages, see Message segmentation.

 

Parent topic:

WebSphere MQ messages


fg10800_