共用方式為


MessagePropertyFilter.Recoverable 屬性

定義

取得或設定值,指出在接收或窺視訊息時是否要擷取 Recoverable 屬性資訊。

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

屬性值

true 表示接收 Recoverable 資訊,否則為 false。 預設為 false

屬性

範例

下列程式代碼範例示範 如何使用 Recoverable 屬性。

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

備註

類別 RecoverableMessage 屬性指出是否保證傳遞訊息,即使計算機在訊息路由傳送至目的地佇列時當機也一樣。

如果保證傳遞訊息,訊息會儲存在每一個步驟本機,直到訊息成功轉送到下一部計算機為止。 在訊息上將 設定 Message.Recoverabletrue 可能會影響輸送量。

適用於

另請參閱