Message.UseDeadLetterQueue 屬性


取得或設定值,指出是否應該將無法傳遞的訊息複本傳送至無法投遞的信件佇列。Gets or sets a value that indicates whether a copy of the message that could not be delivered should be sent to a dead-letter queue.

 property bool UseDeadLetterQueue { bool get(); void set(bool value); };
public bool UseDeadLetterQueue { get; set; }
member this.UseDeadLetterQueue : bool with get, set
Public Property UseDeadLetterQueue As Boolean



如果訊息傳遞錯誤會導致將訊息複本傳送至無法投遞的信件佇列,則為 true,否則為 falsetrue if message-delivery failure should result in a copy of the message being sent to a dead-letter queue; otherwise, false. 預設為 falseThe default is false.



篩選訊息佇列以忽略 UseDeadLetterQueue 屬性。The message queue is filtered to ignore the UseDeadLetterQueue property.


下列程式碼範例會取得並設定訊息屬性的值 UseDeadLetterQueueThe following code example gets and sets the value of a message's UseDeadLetterQueue property.


UseJournalQueueUseDeadLetterQueue 屬性會指定訊息佇列追蹤訊息的方式。The UseJournalQueue and UseDeadLetterQueue properties specify how Message Queuing tracks a message. 如果 UseDeadLetterQueuetrue ,非交易式訊息) 的傳遞失敗 (,會導致訊息傳送至無法傳遞訊息的電腦上的非交易式寄不出信件佇列。If UseDeadLetterQueue is true, delivery failure (of a non-transactional message), causes the message to be sent to the non-transactional dead-letter queue on the computer that could not deliver the message. 例如,訊息計時器過期可能會導致傳遞失敗。Delivery failure could be caused by a message timer expiring, for example.

在交易式訊息的傳遞失敗案例中,訊息佇列會將訊息傳送至來源電腦上的交易式寄不出的信件佇列,但在所有負面和不確定的情況下。In the case of delivery failure for a transactional message, Message Queuing sends the message to the transactional dead-letter queue on the source machine in all negative and in-doubt cases.

當您將訊息儲存在寄不出的信件佇列時,您應該定期清除佇列,以移除不再需要的訊息。When you store messages in a dead-letter queue, you should clear the queue periodically to remove messages that are no longer needed. 儲存在寄不出的信件佇列中的訊息,會根據佇列所在之電腦的大小配額來計算。Messages stored in dead-letter queues count against the size quota for the computer where the queue resides. 電腦配額是由系統管理員所設定,而且是指配置給整個電腦上儲存訊息的大小,而不只是單一佇列。The computer quota is set by the administrator and refers to the size allocated for storing messages on the whole computer, not just in a single queue.

您不會建立日誌或寄不出的信件佇列。You do not create a journal or dead-letter queue. 這些都是訊息佇列所產生的兩個系統佇列。These are both system queues that Message Queuing generates.