Sun GlassFish Message Queue 4.4 Developer's Guide for C Clients

Parameters

messageHandle

A handle to a message.

headersHandle

A handle to the header properties object. This handle will be invalid after the function returns successfully.

After you have created a properties handle and defined values for message header properties using one of the MQSet...Property functions, you can pass the handle to the MQSetMessageHeaders function to define the message header properties.

The message header properties are described in the table below. For sending messages, the client can only set two of these: the correlation ID property and the message type property. The client is not required to set these; they are provided for the client’s convenience. For example, the client can use the key MQ_MESSAGE_TYPE_HEADER_PROPERTY to sort incoming messages according to application-defined message types.

Table 4–6 Message Header Properties

Key 

Type 

Set By 


MQ_CORRELATION_ID_HEADER_PROPERTY

MQString

Client (optional) 


MQ_MESSAGE_TYPE_HEADER_PROPERTY

MQString

Client (optional) 


MQ_PERSISTENT_HEADER_PROPERTY

MQBool

Send function 


MQ_EXPIRATION_HEADER_PROPERTY

MQInt64

Send function 


MQ_PRIORITY_HEADER_PROPERTY

MQInt8

Send function 


MQ_TIMESTAMP_HEADER_PROPERTY

MQInt64

Send function 


MQ_MESSAGE_ID_HEADER_PROPERTY

MQString

Send function 


MQ_REDELIVERED_HEADER_PROPERTY

MQBool

Message Broker 

Header properties that are not specified in the headersHandle are not affected. You cannot use this function to override header properties that are set by the broker or the send function. The header properties for persistence, expiration, and priority (MQSetMessageHeaders)() are set to default values if the user called the MQSendMessage() or MQSendMessageToDestination() function, or they are set to values the user specifies (in parameters) if the user called the MQSendMessageExt() or the MQSendMessageToDestinationExt() function.

Use the MQSetBytesMessageBytes() function or the MQSetTextMessageText() function to set the body of a message. Use the MQSetMessageProperties() function to set the application-defined properties of a message that are not part of the header.