MessagePropertyFilter.Label Property

 

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

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

[MessagingDescriptionAttribute("MsgLabel")]
public bool Label { get; set; }

Property Value

Type: System.Boolean

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

The Label property of the Message class specifies the label of the message.

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

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

.NET Framework
Available since 1.1
Return to top
Show: