Home
BufferLength (MQLONG) - input
The length of the message in Buffer. Zero is valid, and indicates that the message contains no application data. The upper limit for BufferLength depends on various factors:
- If the destination is a local queue or resolves to a local queue, the upper limit depends on whether:
- The local queue manager supports segmentation.
- The sending application specifies the flag that allows the queue manager to segment the message. This flag is MQMF_SEGMENTATION_ALLOWED, and can be specified either in a version-2 MQMD, or in an MQMDE used with a version-1 MQMD.
If both of these conditions are satisfied, BufferLength cannot exceed 999 999 999 minus the value of the Offset field in MQMD. The longest logical message that can be put is therefore 999 999 999 bytes (when Offset is zero). However, resource constraints imposed by the operating system or environment in which the application is running might result in a lower limit.
If one or both of the above conditions is not satisfied, BufferLength cannot exceed the smaller of the queue's MaxMsgLength attribute and queue-manager's MaxMsgLength attribute.
- If the destination is a remote queue or resolves to a remote queue, the conditions for local queues apply, but at each queue manager through which the message must pass in order to reach the destination queue; in particular:
- The local transmission queue used to store the message temporarily at the local queue manager
- Intermediate transmission queues (if any) used to store the message at queue managers on the route between the local and destination queue managers
- The destination queue at the destination queue manager
The longest message that can be put is therefore governed by the most restrictive of these queues and queue managers.
When a message is on a transmission queue, additional information resides with the message data, and this reduces the amount of application data that can be carried. In this situation, subtract MQ_MSG_HEADER_LENGTH bytes from the MaxMsgLength values of the transmission queues when determining the limit for BufferLength.
Note:Only failure to comply with condition 1 can be diagnosed synchronously (with reason code MQRC_MSG_TOO_BIG_FOR_Q or MQRC_MSG_TOO_BIG_FOR_Q_MGR) when the message is put. If conditions 2 or 3 are not satisfied, the message is redirected to a dead-letter (undelivered-message) queue, either at an intermediate queue manager or at the destination queue manager. If this happens, a report message is generated if one was requested by the sender.
Home