[UNIX, Linux, Windows, IBM i]

Message segmentation

Use this information to learn about segmenting messages. This feature is not supported on IBM® MQ for z/OS® or by applications using IBM MQ classes for JMS.

Increasing the maximum message length as explained in topic Increasing the maximum message length has some negative implications. Also, it can still result in the message being too large for the queue or queue manager. In these cases, you can segment a message. For information about segments, see Message groups.

The next sections look at common uses for segmenting messages. For putting and destructively getting, it is assumed that the MQPUT or MQGET calls always operate within a unit of work. Always consider using this technique to reduce the possibility of incomplete groups being present in the network. Single-phase commit by the queue manager is assumed, but other coordination techniques are equally valid.

Also, in the getting applications, it is assumed that if multiple servers are processing the same queue, each server executes similar code, so that one server never fails to find a message or segment that it expects to be there (because it had specified MQGMO_ALL_MSGS_AVAILABLE or MQGMO_ALL_SEGMENTS_AVAILABLE earlier).
Attention: When using publish/subscribe to send messages to a topic (or putting messages to a topic alias) message grouping and segmentation is not permitted. 

Because subscriptions can be created and removed independently of publication activity, it cannot be assured that a subscriber would receive a full message group or all segments of a message; see RC2417: MQRC_MSG_NOT_ALLOWED_IN_GROUP.

Putting and getting a segmented message that spans units of work

You can put and get a segmented message that spans a unit of work in a similar way to Putting and getting a group that spans units of work.

You cannot, however, put or get segmented messages in a global unit of work.