Sending messages is typically a two-function operation: a single call to MQOpenQueue to open the queue and then one or more calls to MQSendMessage. After the queue is opened, the application can send any number of messages to the queue.
For examples of sending different types of messages, see:
Note Transaction messages can only be sent to transaction queues, and non-transaction messages can only be sent to non-transaction queues.
Message are defined by a set of properties specified in an MQMSGPROPS structure. This structure provides the number of properties that will be sent with the message, identifiers for each property, and the value of each property.
The following are general message properties that can be set by the application (length properties that are associated with another property are not included):
Security message properties are used for authenticating and encrypting messages. The following security message properties can be set by the application:
The following message properties are set by MSMQ and should not be specified by the sending application. They are attached to the message when it is sent.
Message Property | Description |
---|---|
PROPID_M_ARRIVEDTIME | Indicates when the message arrived at its target queue. |
PROPID_M_AUTHENTICATED | Indicates if the message was authenticated. |
PROPID_M_CLASS | Indicates the type of message (such as normal, acknowledgment, or report). |
PROPID_M_DEST_QUEUE | Indicates the destination of the message. |
PROPID_M_MSGID | Indicates the message's MSMQ-generated identifier. |
PROPID_M_SENDERID | Indicates the identifier of the sending application. |
PROPID_M_SENDERID_TYPE | Indicates the type of identifier found by MSMQ. |
PROPID_M_SENTTIME | Indicates when the message was sent. |
PROPID_M_SIGNATURE | Indicates the digital signature of the message. |
PROPID_M_SRC_MACHINE_ID | Indicates the machine identifier of the computer from where the message was sent. |
PROPID_M_VERSION | Indicates what version of MSMQ the sending application is running. |