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, we 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).
Put and getting a segmented message that spans units of work
We can put and get a segmented message that spans a unit of work in a similar way to Put and getting a group that spans units of work.
We cannot, however, put or get segmented messages in a global unit of work.
- Segmentation and reassembly by queue manager
This is the simplest scenario, in which one application puts a message to be retrieved by another. The message might be large: not too large for either the putting or the getting application to handle in a single buffer, but too large for the queue manager or a queue on which the message is to be put. - Application segmentation
Application segmentation is used when queue manager segmentation is not adequate, or when applications require data conversion with specific segment boundaries. - Application segmentation of logical messages
The messages must be maintained in logical order in a group, and some or all of them might be so large that they require application segmentation.
Parent topic: Handling messages greater than 4 MB long