Create a message using either the MQCreateBytesMessage() function or the MQCreateTextMessage() function. Either of these functions returns a message handle that you can then pass to the functions you use to set the message body, header, and properties (listed in Composing Messages()). You can also use the MQCreateMessage() function to create a message that has a header and properties but no message body.
Use the MQSetTextMessageText() function to define the body of a text message; use the MQSetBytesMessageBytes() function to define the body of a bytes message.
Use the MQSetMessageHeaders() to set any message header properties.
The message header can specify up to eight properties; most of these are set by the client runtime when sending the message or are set by the broker. The client can set MQ_CORRELATION_ID_HEADER_PROPERTY and MQ_MESSAGE_TYPE_HEADER_PROPERTY for sending a message.
Use the MQSetMessageProperties() function to set any user-defined properties for this message.
When you set message header properties or when you set additional user-defined properties, you must pass a handle to a properties object that you have created using the MQCreateProperties() function. For more information, see Working With Properties.
You can use the MQSetMessageReplyTo() function to associate a message with a destination that recipients can use for replies. To do this, you must first create a destination that will serve as your reply-to destination. Then, pass a handle to that destination when you call the MQSetMessageReplyTo() function. The receiver of a message can use the MQGetMessageReplyTo() function to determine whether a sender has set up a destination where replies are to be sent.