MessagePropertyFilter.Id Property

 

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

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

[MessagingDescriptionAttribute("MsgId")]
public bool Id { get; set; }

Property Value

Type: System.Boolean

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

The Id property of the Message class indicates the Message Queuing-generated unique identifier of the message. This identifier is generated when the message is sent.

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

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

.NET Framework
Available since 1.1
Return to top
Show: