Sun Java System Message Queue 4.3 Developer's Guide for C Clients


The MQSetMessageProperties function sets the specified properties for a message. You can also use this function to change a message's properties.

             (const MQMessageHandle messageHandle,
              MQPropertiesHandle propsHandle);

Return Value

MQStatus. See the MQStatusIsError() function for more information.



A handle to a message whose application-defined properties you want to set.


A handle to a properties object that you have created and set using one of the set property functions. This handle is invalid after the function returns.

After you obtain the handle to a message, you can use this handle to define its body with the MQSetBytesMessageBytes() or MQSetTextMessageText() function, and to set its header properties with the MQSetMessageHeaders() function.

Property values are set prior to sending a message. The MQSetMessageProperties function allows you to set application-defined properties for a message. For example, application-defined properties allow an application, via message selectors, to select or filter, messages on its behalf using application-specific criteria.

You define the message properties and their values using the MQCreateProperties() function to create a properties object, then you use one of the set property functions to define each key and value in it. See Working With Properties for more information.