MessagePropertyFilter.TransactionId Eigenschaft

Definition

Ruft einen Wert ab, der angibt, ob beim Einsehen oder beim Empfang einer Meldung die TransactionId-Eigenschaft abgerufen wird, oder legt diesen fest.

public:
 property bool TransactionId { bool get(); void set(bool value); };
[System.Messaging.MessagingDescription("MsgTransactionId")]
public bool TransactionId { get; set; }
[<System.Messaging.MessagingDescription("MsgTransactionId")>]
member this.TransactionId : bool with get, set
Public Property TransactionId As Boolean

Eigenschaftswert

true, wenn Informationen über den TransactionId abgerufen werden, andernfalls false. Der Standardwert ist false.

Attribute

Beispiele

Im folgenden Codebeispiel wird die Verwendung des TransactionId-Attributs veranschaulicht.

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

Hinweise

Die TransactionId -Eigenschaft der Message -Klasse identifiziert die Transaktion, die die Nachricht gesendet hat. Verwenden Sie diese Eigenschaft in einer empfangenden Anwendung, um zu überprüfen, ob eine Nachricht als Teil einer bestimmten Transaktion gesendet wurde.

Gilt für:

Weitere Informationen