Message.TransactionId Property


Gets the identifier for the transaction of which the message was a part.

 property System::String ^ TransactionId { System::String ^ get(); };
public string TransactionId { get; }
member this.TransactionId : string
Public ReadOnly Property TransactionId As String

Property Value


The identifier for the transaction associated with the message.



The message has not been sent. This property can only be read on messages retrieved from a queue.


The message queue is filtered to ignore the TransactionId property.


The following code example displays the value of a message's TransactionId property.


Receiving applications use the TransactionId property to verify that a message was sent as part of a specific transaction. The transaction identifier contains the identifier of the sending computer (first 16 bits) followed by a 4-byte transaction sequence number.

This property is available only for Message Queuing version 2.0 and later.

Transaction identifiers are not guaranteed to be unique, because transaction sequence numbers are not persistent, and they start over again at 2 20. Message Queuing guarantees only that subsequent transactions will have different transaction sequence numbers.

You can use the TransactionId property along with the IsFirstInTransaction and IsLastInTransaction properties to verify transaction boundaries.

Applies to

See also