Επεξεργασία

Κοινή χρήση μέσω


DeliveryFailure Enum

Definition

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
Inheritance
DeliveryFailure

Fields

Name Value Description
Unknown 0

An unknown error occurred.

BadDestinationQueue 32768

The destination queue was not found.

Purged 32769

The message was purged before reaching the destination queue.

ReachQueueTimeout 32770

The message did not reach the destination queue before timing out.

QueueExceedMaximumSize 32771

The message was not delivered because the destination queue is full.

AccessDenied 32772

The sender does not have access rights to place messages in the destination queue.

HopCountExceeded 32773

The message hop count was exceeded, which indicates the number of intermediate servers.

BadSignature 32774

The destination queue manager cannot authenticate the message because the attached signature is invalid.

BadEncryption 32775

The destination queue manager cannot decrypt the message.

CouldNotEncrypt 32776

The source queue manager cannot encrypt the message.

NotTransactionalQueue 32777

A transactional message was sent to a nontransactional queue.

NotTransactionalMessage 32778

A nontransactional message was sent to a transactional queue.

QueueDeleted 49152

The destination queue was deleted before the message could be delivered to the application.

QueuePurged 49153

The queue was purged and the message no longer exists.

ReceiveTimeout 49154

The message was not delivered to the application on time.

Examples

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);
    Console.WriteLine();
}
<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)
    Console.WriteLine()
End Sub

Remarks

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.

Applies to

See also