MessagePropertyFilter.TransactionId Свойство

Определение

Получает или задает значение, указывающее, следует ли извлекать сведения свойства TransactionId при получении или считывании сообщения.

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

Значение свойства

Значение true означает получение сведений TransactionId, в противном случае — значение false. Значение по умолчанию — false.

Атрибуты

Примеры

В следующем примере кода демонстрируется использование 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);
// 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);

Комментарии

Свойство TransactionIdMessage класса идентифицирует транзакцию, которая отправила сообщение. Используйте это свойство в принимающем приложении, чтобы убедиться, что сообщение было отправлено в рамках определенной транзакции.

Применяется к

См. также раздел