MsmqElementBase.ReceiveErrorHandling 屬性

定義

取得或設定列舉值,這個值會指定如何處理有害和不可分派的訊息。

public:
 property System::ServiceModel::ReceiveErrorHandling ReceiveErrorHandling { System::ServiceModel::ReceiveErrorHandling get(); void set(System::ServiceModel::ReceiveErrorHandling value); };
[System.Configuration.ConfigurationProperty("receiveErrorHandling", DefaultValue=System.ServiceModel.ReceiveErrorHandling.Fault)]
public System.ServiceModel.ReceiveErrorHandling ReceiveErrorHandling { get; set; }
[<System.Configuration.ConfigurationProperty("receiveErrorHandling", DefaultValue=System.ServiceModel.ReceiveErrorHandling.Fault)>]
member this.ReceiveErrorHandling : System.ServiceModel.ReceiveErrorHandling with get, set
Public Property ReceiveErrorHandling As ReceiveErrorHandling

屬性值

ReceiveErrorHandling 值,指定如何處理有害和不可分派的訊息。

屬性

備註

當這個屬性設定為 Fault 時,通道接聽程式會發生錯誤,並且會追蹤和擲回 ProtocolException (內含一個 MsmqPoisonMessageException)。 有問題的訊息會留在佇列中,並且需要由某種手動方法來移除。 MsmqPoisonMessageException 包含 MessageLookupId,後者可用於從有害訊息佇列中識別並手動移除有問題的訊息。

當這個屬性設定為 Drop 時,只會捨棄有問題的訊息。

當這個屬性設定為 Reject 時,負認可會傳送至用戶端,並從有害訊息佇列中移除問題訊息。 這個選項只能在訊息佇列 (亦稱為 MSMQ) 4.0 上使用。

當設定為 Move 時,有問題的訊息會移到最後一個有害子佇列。 只有在 Message Queuing 4.0 上才能使用這個選項。

適用於