Export (0) Print
Expand All

Message.AttachSenderId Property

Gets or sets a value that indicates whether the sender ID should be attached to the message.

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

[MessagingDescriptionAttribute("MsgAttachSenderId")]
public bool AttachSenderId { get; set; }

Property Value

Type: System.Boolean
true if the SenderId should be attached to the message; otherwise, false. The default is true.

ExceptionCondition
InvalidOperationException

The message queue is filtered to ignore the AttachSenderId property.

The SenderId property is an array of bytes that represents the identifier of the sending user. The sender ID is set by Message Queuing and is used by the receiving Queue Manager to verify whether the sender has access rights to a queue.

The absence of the sender ID is an indication by the sending application that Message Queuing should not validate the message's sender nor verify the sender's access rights to the receiving queue. The SenderId is trustworthy only if the message was authenticated when it reached the destination queue. The message is rejected when it reaches the destination queue if the queue accepts only authenticated messages and either the UseAuthentication or the AttachSenderId property is false.

Caution noteCaution

If a message is rejected, it is either sent to the dead-letter queue (if UseDeadLetterQueue is true), or it is ignored. You can request acknowledgments when a message fails to reach a queue. Otherwise, when UseDeadLetterQueue is false the message might be lost without warning.

The following code example gets and sets the value of a message's AttachSenderId property.

// Set the message's AttachSenderId property.
orderMessage.AttachSenderId = true;

// Display the new value of the message's AttachSenderId property.
Console.WriteLine("Message.AttachSenderId: {0}",
    orderMessage.AttachSenderId);

.NET Framework

Supported in: 4.5.2, 4.5.1, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft