MSMQMessage.Ack

 

Applies To: Windows 10, Windows 7, Windows 8, Windows 8.1, Windows Server 2008, Windows Server 2008 R2, Windows Server 2012, Windows Server 2012 R2, Windows Server Technical Preview, Windows Vista

The Ack property specifies the type of acknowledgment messages that Message Queuing will post (in the administration queue) when acknowledgments are requested.

Data type: Long
Run-time access: Read/write
Property Ack As Long  

Property Value

The Ack property can have any one of the following values:

MQMSG_ACKNOWLEDGMENT_FULL_REACH_QUEUE

Posts a positive or negative acknowledgment depending on whether or not the message reaches the queue.

A negative acknowledgment is posted when the time-to-reach-queue timer of the message expires, or when Message Queuing does not deliver the message to the queue for security reasons. These security reasons can include denied send access to the sending application, not being able to authenticate a message, as well as the queue not being able to accept encrypted messages.

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 Message Queuing does not deliver the message to the queue for security reasons. These security reasons can include denied send access to the sending application, not being able to authenticate a message, as well as the queue not being able to accept encrypted messages.

MQMSG_ACKNOWLEDGMENT_FULL_RECEIVE

Posts a positive or negative acknowledgment depending on whether or not the message is retrieved from the queue before its time-to-be-received timer expires.

MQMSG_ACKNOWLEDGMENT_NACK_RECEIVE

Posts a negative acknowledgment when the message cannot be retrieved from the queue before the message's time-to-be-received timer expires.

MQMSG_ACKNOWLEDGMENT_NONE

The default. No acknowledgment messages (positive or negative) are posted.

Remarks

To receive a positive acknowledgment message when a message reaches its destination and when the message is retrieved, the following two full-acknowledgment settings must be combined by means of the OR operator: MQMSG_FULL_REACH_QUEUE and MQMSG_FULL_RECEIVE.

To request acknowledgment messages, the sending application must set Ack and MSMQMessage.AdminQueueInfo when sending messages.

To find out if acknowledgment messages were requested, the receiving application can examine Ack and MSMQMessage.AdminQueueInfo when it reads the messages in the queue.

For information on the purpose and content of acknowledgment messages, see Acknowledgment Messages.

Equivalent API Function Property

With API function calls, the equivalent property is PROPID_M_ACKNOWLEDGE.

Example Code

The following examples are included in Using Message Queuing.

For an example of See
Sending messages that request acknowledgment messages Visual Basic Code Example: Requesting Acknowledgment Messages
Verifying that acknowledgments were requested Visual Basic Code Example: Verifying Acknowledgment Requests
Matching returned acknowledgment messages to the original message sent Visual Basic Code Example: Matching Acknowledgment Messages
Filtering acknowledgment messages based on acknowledgment class Visual Basic Code Example: Acknowledgment Class Filter
Returning acknowledgments (through connector applications) Visual Basic Code Example: Returning Acknowledgment Messages (Connector Applications)

Requirements

Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later

Windows 95/98/Me: Included in Windows 95 and later.

Header: Declared in Mqoai.h.

Library: Use Mqoa.lib

See Also

MSMQMessage.AdminQueueInfo
MSMQMessage.MsgClass
MSMQMessage.Id
MSMQMessage.MaxTimeToReachQueue
MSMQMessage.MaxTimeToReceive
PROPID_M_ACKNOWLEDGE