PROPID_M_DELIVERY
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 PROPID_M_DELIVERY property specifies how Message Queuing delivers the message to the queue.
Property ID
PROPID_M_DELIVERY
Type Indicator
VT_UI1
MQPROPVARIANT Field
bVal
Property Value
This property can be set to one of the following values:
MQMSG_DELIVERY_RECOVERABLE
In every hop along its route, the message is stored locally on disk until it is forwarded to the next computer. This guarantees delivery even in case of a computer crash. When the message is placed in the destination queue, it is written to disk in a memory-mapped file.
MQMSG_DELIVERY_EXPRESS
The default. The message stays in volatile memory along its entire route until it is received. The message is not recovered if the computer where the message resides is rebooted. An express message delivered to a queue on a virtual server in a cluster will be lost if the virtual server fails over before the message is received.
Remarks
When the delivery mode of a message is set to MQMSG_DELIVERY_EXPRESS (the default setting), the message has faster throughput. When the delivery mode is set to MQMSG_DELIVERY_RECOVERABLE, throughput may be slower, but Message Queuing guarantees that the message will be delivered, even if a computer crashes while the message is en-route to the queue. For a comparison of express and recoverable messaging, see Express and Recoverable Messaging.
To set the delivery mode of a message, specify PROPID_M_DELIVERY in the MQMSGPROPS structure and call MQSendMessage.
To retrieve the delivery mode of a message, specify PROPID_M_DELIVERY in the MQMSGPROPS structure. Then call MQReceiveMessage or MQReceiveMessageByLookupId and examine its returned value. When retrieving this property, the type indicator can be set to VT_UI1 or VT_NULL. If you set the type indicator to VT_NULL, Message Queuing automatically changes the type indicator to VT_UI1 during the function call.
When sending messages within a transaction, Message Queuing always sets the delivery mode of the transactional message to MQMSG_DELIVERY_RECOVERABLE.
Equivalent COM Property
With COM components, the equivalent property for setting and retrieving the delivery mode is MSMQMessage.Delivery.
For information on | See |
---|---|
Sending message within a transaction | Transactions |
Example Code
The following code fragments show how PROPID_M_DELIVERY is specified in arrays that can be used to initialize an MQMSGPROPS structure to request recoverable delivery and to ascertain the type of delivery.
To Specify the Type of Delivery
aMsgPropId[i] = PROPID_M_DELIVERY; // Property ID
aMsgPropVar[i].vt = VT_UI1; // Type indicator
aMsgPropVar[i].bVal = MQMSG_DELIVERY_RECOVERABLE;
i++;
To Retrieve the Type of Delivery
aMsgPropId[i] = PROPID_M_DELIVERY; // Property ID
aMsgPropVar[i].vt = VT_NULL; // Type indicator
i++;
See Also
Message Properties
MQMSGPROPS
MQReceiveMessage
MQReceiveMessageByLookupId
MQSendMessage