This documentation is archived and is not being maintained.

DeliveryFailure Enumeration

Specifies the possible types of delivery failure for a message read from the queue.

Namespace:  System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public enum DeliveryFailure

Member nameDescription
UnknownAn unknown error occurred.
AccessDeniedThe sender does not have access rights to place messages in the destination queue.
BadDestinationQueueThe destination queue was not found.
BadEncryptionThe destination queue manager cannot decrypt the message.
BadSignatureThe destination queue manager cannot authenticate the message because the attached signature is invalid.
CouldNotEncryptThe source queue manager cannot encrypt the message.
HopCountExceededThe message hop count was exceeded, which indicates the number of intermediate servers.
NotTransactionalQueueA transactional message was sent to a nontransactional queue.
NotTransactionalMessageA nontransactional message was sent to a transactional queue.
PurgedThe message was purged before reaching the destination queue.
QueueDeletedThe destination queue was deleted before the message could be delivered to the application.
QueueExceedMaximumSizeThe message was not delivered because the destination queue is full.
QueuePurgedThe queue was purged and the message no longer exists.
ReachQueueTimeoutThe message did not reach the destination queue before timing out.
ReceiveTimeoutThe message was not delivered to the application on time.

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.

The 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);

Windows 7, Windows Vista, Windows XP SP2, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0