DeliveryFailure 列舉


針對從佇列讀取的訊息指定可能的傳遞失敗類型。Specifies the possible types of delivery failure for a message read from the queue.

public enum class DeliveryFailure
public enum DeliveryFailure
type DeliveryFailure = 
Public Enum DeliveryFailure


AccessDenied 32772

寄件者沒有將訊息放到目的佇列所需的存取權限。The sender does not have access rights to place messages in the destination queue.

BadDestinationQueue 32768

找不到目的佇列。The destination queue was not found.

BadEncryption 32775

目的佇列管理員無法解密訊息。The destination queue manager cannot decrypt the message.

BadSignature 32774

目的佇列管理員無法驗證訊息,因為附加的簽章 (Signature) 無效。The destination queue manager cannot authenticate the message because the attached signature is invalid.

CouldNotEncrypt 32776

來源佇列管理員無法加密訊息。The source queue manager cannot encrypt the message.

HopCountExceeded 32773

超出了訊息的躍點計數,此計數表示中繼伺服器的數目。The message hop count was exceeded, which indicates the number of intermediate servers.

NotTransactionalMessage 32778

非異動式訊息已傳送至異動式佇列。A nontransactional message was sent to a transactional queue.

NotTransactionalQueue 32777

交易式訊息已傳送至非交易式佇列。A transactional message was sent to a nontransactional queue.

Purged 32769

訊息在抵達目的佇列之前已遭到清除。The message was purged before reaching the destination queue.

QueueDeleted 49152

在訊息可以傳遞至應用程式之前,目的佇列已遭到刪除。The destination queue was deleted before the message could be delivered to the application.

QueueExceedMaximumSize 32771

未傳遞訊息,因為目的佇列已滿。The message was not delivered because the destination queue is full.

QueuePurged 49153

此佇列已遭到清除,訊息也不復存在。The queue was purged and the message no longer exists.

ReachQueueTimeout 32770

訊息沒有在逾時之前到達目的佇列。The message did not reach the destination queue before timing out.

ReceiveTimeout 49154

訊息未能準時傳遞給應用程式。The message was not delivered to the application on time.

Unknown 0

發生未知的錯誤。An unknown error occurred.


底下的範例會示範如何在服務作業內存取訊息的 DeliveryFailureThe example below shows how to access the DeliveryFailure of a message within a service operation.

public void SimpleSubmitPurchaseOrder(PurchaseOrder po)
    Console.WriteLine("Submitting purchase order did not succeed ", po);
    MsmqMessageProperty mqProp = OperationContext.Current.IncomingMessageProperties[MsmqMessageProperty.Name] as MsmqMessageProperty;

    Console.WriteLine("Message Delivery Status: {0} ", mqProp.DeliveryStatus);
    Console.WriteLine("Message Delivery Failure: {0}", mqProp.DeliveryFailure);
<OperationBehavior(TransactionScopeRequired := True, TransactionAutoComplete := True)> _
Public Sub SimpleSubmitPurchaseOrder(ByVal po As PurchaseOrder)
    Console.WriteLine("Submitting purchase order did not succeed ", po)
    Dim mqProp As MsmqMessageProperty = TryCast(OperationContext.Current.IncomingMessageProperties(MsmqMessageProperty.Name), MsmqMessageProperty)

    Console.WriteLine("Message Delivery Status: {0} ", mqProp.DeliveryStatus)
    Console.WriteLine("Message Delivery Failure: {0}", mqProp.DeliveryFailure)
End Sub


您可以取得 DeliveryFailure 屬性來判斷訊息傳遞失敗及傳送至寄不出的信件佇列的原因。You can get the DeliveryFailure property to determine why a message failed delivery and was sent to the dead-letter queue. 如需寄不出的信件佇列中訊息處理的詳細資訊, 請參閱使用寄不出的信件佇列來處理訊息傳輸失敗For additional information about message processing in a dead-letter queue, see Using Dead-Letter Queues to Handle Message Transfer Failures.