Home
DataLength (MQLONG) - output
This is the length in bytes of the application data in the message. If this is greater than BufferLength, only BufferLength bytes are returned in the Buffer parameter (that is, the message is truncated). If the value is zero, the message contains no application data.
If BufferLength is less than the message length, DataLength is still filled in by the queue manager, whether or not MQGMO_ACCEPT_TRUNCATED_MSG is specified on the GetMsgOpts parameter (see MQGMO - Options field for more information). This allows the application to determine the size of the buffer required to accommodate the message data, and then reissue the call with a buffer of the appropriate size.
However, if the MQGMO_CONVERT option is specified, and the converted message data is too long to fit in Buffer, the value returned for DataLength is:
- The length of the unconverted data, for queue-manager defined formats.
In this case, if the nature of the data causes it to expand during conversion, the application must allocate a buffer somewhat bigger than the value returned by the queue manager for DataLength.
- The value returned by the data-conversion exit, for application-defined formats.
Home