Important: |
---|
This is retired content. This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This content may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist. |
This property specifies the type of acknowledgment messages the system posts (in the administration queue) and when acknowledgments are returned.
- Type Indicator
-
VT_UI1 (or VT_NULL)
- PROPVARIANT Field
-
bVal
- Property Values
-
This property can be set to one or more of the following values using the ORoperator.
Value Description MQMSG_ACKNOWLEDGMENT_FULL_REACH_QUEUE
Posts a positive or negative acknowledgment depending on whether the message reaches the queue.
A negative acknowledgment is posted when the time-to-reach-queue timer of the message expires or when the message cannot be authenticated.
MQMSG_ACKNOWLEDGMENT_NACK_REACH_QUEUE
Posts a negative acknowledgment when the message cannot reach the queue.
A negative acknowledgment is posted when the time-to-reach-queue timer of the message expires or when the message cannot be authenticated.
MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE
Posts a positive or negative acknowledgment depending on whether the message is retrieved from the queue before its time-to-be-received timer expires.
MQMSG_ACKNOWLEDGMENT_NACK_RECEIVE
Posts a negative acknowledgment when an error occurs and the message cannot be retrieved from the queue before its time-to-be-received timer expires.
MQMSG_ACKNOWLEDGMENT_NONE
The default. No acknowledgment messages (positive or negative) are posted.
Remarks
When asking for acknowledgments, you must also specify the administration queue where the acknowledgment messages will be sent.
To request acknowledgment messages, specify PROPID_M_ACKNOWLEDGE and PROPID_M_ADMIN_QUEUEin the MQMSGPROPSstructure and call MQSendMessage.
To find out if an acknowledgment message was requested for a message in a queue, specify PROPID_M_ACKNOWLEDGEin the MQMSGPROPSstructure. Then, call MQReceiveMessageand examine its returned value.
When specifying PROPID_M_ACKNOWLEDGE, you can set its Type Indicator to VT_NULL. When the Type Indicator is set to VT_NULL, MSMQ sets the VT field to the appropriate type indicator.
To receive a positive acknowledgment message when a message reaches its destination and when the message is retrieved, the following full-acknowledgment settings must be combined using the OR operator:
- MQMSG_FULL_REACH_QUEUE
- MQMSG_FULL_RECEIVE
Acknowledgment messages are typically MSMQ-generated messages; however, they can also be created by MSMQ connector applications when sending messages to a foreign queue.
Examples
This example shows how PROPID_M_ACKNOWLEDGE is specified in the MQMSGPROPSstructure.
Copy Code | |
---|---|
aMsgPropId[i] = PROPID_M_ACKNOWLEDGE; // Property ID aMsgPropVar[i].vt = VT_UI1; // Type indicator aMsgPropVar[i].bVal = MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE; i++; |
Note: |
---|
OS versions prior to 2.12 require the MSMQ add-on pack. |
Requirements
Header | mq.h |
Windows Embedded CE | Windows CE 2.0 and later |
Windows Mobile | Windows Mobile Version 5.0 and later |