MessagePropertyFilter.UseDeadLetterQueue Property

 
System_CAPS_noteNote

The .NET API Reference documentation has a new home. Visit the .NET API Browser on docs.microsoft.com to see the new experience.

Gets or sets a value that indicates whether to retrieve Message.UseDeadLetterQueue property information when receiving or peeking a message.

Namespace:   System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

[MessagingDescriptionAttribute("MsgUseDeadLetterQueue")]
public bool UseDeadLetterQueue { get; set; }

Property Value

Type: System.Boolean

true to receive Message.UseDeadLetterQueue information; otherwise, false. The default is true.

The UseDeadLetterQueue property of the Message class specifies whether a copy of a message that could not be delivered should be sent to a dead-letter queue.

The following code example demonstrates the use of the UseDeadLetterQueue property.

// Set the queue's MessageReadPropertyFilter property to enable the
// message's UseDeadLetterQueue property.
queue.MessageReadPropertyFilter.UseDeadLetterQueue = 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 UseDeadLetterQueue property.
Console.WriteLine("Message.UseDeadLetterQueue: {0}",
    orderMessage.UseDeadLetterQueue);

.NET Framework
Available since 1.1
Return to top
Show: