private void InternalFinalDisposition(MsmqQueue disposeFromQueue, MsmqMessageProperty messageProperty) { switch (this.ReceiveParameters.ReceiveErrorHandling) { case ReceiveErrorHandling.Drop: this.receiver.DropOrRejectReceivedMessage(disposeFromQueue, messageProperty, false); break; case ReceiveErrorHandling.Fault: MsmqReceiveHelper.TryAbortTransactionCurrent(); if (null != this.receiver.ChannelListener) { this.receiver.ChannelListener.FaultListener(); } if (null != this.receiver.Channel) { this.receiver.Channel.FaultChannel(); } break; case ReceiveErrorHandling.Reject: this.receiver.DropOrRejectReceivedMessage(disposeFromQueue, messageProperty, true); MsmqDiagnostics.PoisonMessageRejected(messageProperty.MessageId, this.receiver.InstanceId); break; case ReceiveErrorHandling.Move: MsmqReceiveHelper.MoveReceivedMessage(disposeFromQueue, this.poisonQueue, messageProperty.LookupId); MsmqDiagnostics.PoisonMessageMoved(messageProperty.MessageId, true, this.receiver.InstanceId); break; default: Fx.Assert("System.ServiceModel.Channels.Msmq4PoisonHandler.FinalDisposition(): (unexpected ReceiveErrorHandling)"); break; } }
public void FinalDisposition(MsmqMessageProperty messageProperty) { switch (this.receiver.MsmqReceiveParameters.ReceiveErrorHandling) { case ReceiveErrorHandling.Fault: MsmqReceiveHelper.TryAbortTransactionCurrent(); if (this.receiver.ChannelListener != null) { this.receiver.ChannelListener.FaultListener(); } if (this.receiver.Channel == null) { break; } this.receiver.Channel.FaultChannel(); return; case ReceiveErrorHandling.Drop: this.receiver.DropOrRejectReceivedMessage(messageProperty, false); return; case ReceiveErrorHandling.Reject: this.receiver.DropOrRejectReceivedMessage(messageProperty, true); MsmqDiagnostics.PoisonMessageRejected(messageProperty.MessageId, this.receiver.InstanceId); break; default: return; } }