SALES: 1-800-867-1380
DeadLetter Method (String, String)
Collapse the table of content
Expand the table of content

BrokeredMessage.DeadLetter Method (String, String)

 

Moves the message to the dead letter queue.

Namespace:   Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public void DeadLetter(
	string deadLetterReason,
	string deadLetterErrorDescription
)

Parameters

deadLetterReason
Type: System.String

The reason for deadlettering the message.

deadLetterErrorDescription
Type: System.String

The description information for deadlettering the message.

Exception Condition
ObjectDisposedException

Thrown when the message is in disposed state or the receiver with which the message was received is in disposed state.

CommunicationException

Thrown when the queue or subscription that receives the message is no longer present in the message server.

SessionLockLostException

Thrown if the lock on the session has expired. Session lock duration is the same as message LockDuration and is an entity-wide setting. It can be initialized through LockDuration and LockDuration for Queues and Subscriptions respectively.

InvalidOperationException

Thrown when invoked on a message that has not been received from the message server or invoked on a message that has not been received in peek-lock mode.

MessageLockLostException

Thrown if the lock on the message has expired. LockDuration is an entity-wide setting and can be initialized through LockDuration and LockDuration for Queues and Subscriptions respectively.

TimeoutException

Thrown when operation times out. Timeout period is initialized through the MessagingFactorySettings. You may need to increase the value of OperationTimeout to avoid this exception if timeout value is relatively low.

Return to top
Show:
© 2016 Microsoft