Increasing the maximum message length
The MaxMsgLength queue manager attribute defines the maximum length of a message that can be handled by a queue manager. Similarly, the MaxMsgLength queue attribute is the maximum length of a message that can be handled by a queue. The default maximum message length supported depends on the environment in which you are working.
If you are handling large messages, we can alter these attributes independently. We can set the queue manager attribute value between 32768 bytes and 100 MB; we can set the queue attribute value between 0 and 100 MB.
After changing one or both of the MaxMsgLength attributes, restart your applications and channels to ensure that the changes take effect.
When these changes are made, the message length must be less than or equal to both the queue and the queue manager MaxMsgLength attributes. However, existing messages might be longer than either attribute.
If the message is too big for the queue, MQRC_MSG_TOO_BIG_FOR_Q is returned. Similarly, if the message is too big for the queue manager, MQRC_MSG_TOO_BIG_FOR_Q_MGR is returned.
This method of handling large messages is easy and convenient. However, consider the following factors before using it:
- Uniformity among queue managers is reduced. The maximum size of message data is determined by the MaxMsgLength for each queue (including transmission queues) on which the message will be put. This value is often defaulted to the queue manager’s MaxMsgLength, especially for transmission queues. This makes it difficult to predict whether a message is too large when it is to travel to a remote queue manager.
- Usage of system resources is increased. For example, applications need larger buffers, and on some platforms, there might be increased usage of shared storage. Queue storage should be affected only if actually required for larger messages.
- Channel batching is affected. A large message still counts as just one message towards the batch count but needs longer to transmit, thereby increasing response times for other messages.
Parent topic:
Handling messages greater than 4 MB long
fg12680_