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

目标队列管理器无法对消息进行身份验证,原因是附加的签名无效。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.