MessagePropertyFilter.AcknowledgeType Property
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Gets or sets a value that indicates whether to retrieve AcknowledgeType property information when receiving or peeking a message.
public:
property bool AcknowledgeType { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgAcknowledgeType")]
public bool AcknowledgeType { get; set; }
[<System.Messaging.MessagingDescription("MsgAcknowledgeType")>]
member this.AcknowledgeType : bool with get, set
Public Property AcknowledgeType As Boolean
Property Value
true
to receive AcknowledgeType information; otherwise, false
. The default is true
.
- Attributes
Examples
The following code example demonstrates the use of the AcknowledgeType property.
// Set the queue's MessageReadPropertyFilter property
// to enable the message's AcknowledgeType property.
queue->MessageReadPropertyFilter->
AcknowledgeType = true;
// Peek at the message. Time out after ten seconds
// in case the message was not delivered.
orderMessage = queue->Peek(TimeSpan::FromSeconds(10.0));
// Display the value of the message's
// AcknowledgeType property.
Console::WriteLine("Message.AcknowledgeType: {0}",
orderMessage->AcknowledgeType);
// Set the queue's MessageReadPropertyFilter property to enable the
// message's AcknowledgeType property.
queue.MessageReadPropertyFilter.AcknowledgeType = true;
// Peek at the message. Time out after ten seconds in case the message
// was not delivered.
orderMessage = queue.Peek(TimeSpan.FromSeconds(10.0));
// Display the value of the message's AcknowledgeType property.
Console.WriteLine("Message.AcknowledgeType: {0}",
orderMessage.AcknowledgeType);
Remarks
The AcknowledgeType property of the Message class specifies the type of acknowledgment messages requested by the sending application. The type of acknowledgment defines when acknowledgments are returned. Set the Message.AcknowledgeType property before sending the message to request a specific type of acknowledgment.