MessagePropertyFilter.UseDeadLetterQueue Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on 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)

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}",

.NET Framework
Available since 1.1
Return to top