ReceiveErrorHandling Enumeration
Collapse the table of content
Expand the table of content

ReceiveErrorHandling Enumeration


An enumeration that specifies handling for a poison message.

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

public enum ReceiveErrorHandling

Member nameDescription

This option drops the poison message. The message never gets delivered to the application. If the message's TTL had already expired at this point, then the message may appear in the sender's Dead Letter Queue. If not, the message does not appear anywhere. This option indicates that the user does not really care if the message is lost.


This option sends a fault to the listener that caused the ServiceHost to fault. The message must be removed from the application queue by some external mechanism before the application can continue to process messages from the queue.


This moves the poison message to a Poison Message Queue for later processing by a poison message handling application.


This instructs MSMQ to send a negative acknowledgement back to the sending queue manager that the message cannot be received by the application. The message is placed in the sending queue manager's Dead Letter Queue.

A poison message is a message that fails repeated attempts to deliver to the application. This is applicable only when using a Message Queuing (MSMQ)-based binding. The default value is Fault, which faults the listener and therefore the ServiceHost. In the case where the service was to fault because of a poison message, a MsmqPoisonMessageException is thrown. The exception contains the LookupId of the MSMQ message that can be used to move the message out of the way using System.Messaging API. Certain values of the ReceiveErrorHandling enumeration such as Reject and Move are only available on Windows Vista. You control poison message handling by setting the ReceiveErrorHandling property to one of the values of this enumeration.

The following configuration code illustrates how to set this property in the service configuration file:

.NET Framework
Available since 3.0
Return to top
© 2015 Microsoft