ReceiveErrorHandling 열거형

정의

포이즌 메시지의 처리를 지정합니다.

public enum class ReceiveErrorHandling
public enum ReceiveErrorHandling
type ReceiveErrorHandling = 
Public Enum ReceiveErrorHandling
상속
ReceiveErrorHandling

필드

Drop 1

이 옵션은 포이즌 메시지를 삭제합니다. 이 메시지는 애플리케이션에 배달되지 않습니다. 이 시점에서 메시지의 TTL이 이미 만료된 경우 메시지가 발신자의 배달 못 한 편지 큐에 나타날 수 있습니다. 그렇지 않으면 메시지는 아무 곳에서도 표시되지 않습니다. 이 옵션은 메시지가 손실된 경우 사용자가 실제로 주의하지 않았음을 나타냅니다.

Fault 0

이 옵션은 ServiceHost에 오류를 일으킨 수신기에 오류를 보냅니다. 애플리케이션이 큐의 메시지를 계속 처리하려면 외부 메커니즘을 통해 애플리케이션 큐에서 메시지를 제거해야 합니다.

Move 3

이 옵션은 포이즌 메시지 처리 애플리케이션이 나중에 처리할 수 있도록 포이즌 메시지를 포이즌 메시지 큐로 이동합니다.

Reject 2

이 옵션은 애플리케이션에서 메시지를 받을 수 없다는 부정 확인 메시지를 MSMQ가 전송 큐 관리자에게 보내도록 합니다. 이 메시지는 전송 큐 관리자의 배달 못 한 편지 큐에 배치됩니다.

예제

다음 구성 코드에서는 서비스 구성 파일에서 이 속성을 설정하는 방법을 보여 줍니다.

<configuration>
  <appSettings>
    <!-- use appSetting to configure MSMQ queue name -->
    <add key="queueName" value=".\private$\ServiceModelSamplesPoison" />
    <add key="baseAddress" value="http://localhost:8000/orderProcessor/poisonSample"/>
  </appSettings>
  <system.serviceModel>
    <services>
      <service 
              name="Microsoft.ServiceModel.Samples.OrderProcessorService">
        <!-- Define NetMsmqEndpoint -->
        <endpoint address="net.msmq://localhost/private/ServiceModelSamplesPoison"
                  binding="netMsmqBinding"
                  bindingConfiguration="PoisonBinding" 
                  contract="Microsoft.ServiceModel.Samples.IOrderProcessor" />
      </service>
    </services>

    <bindings>
      <netMsmqBinding>
        <binding name="PoisonBinding" 
                 receiveRetryCount="0"
                 maxRetryCycles="1"
                 retryCycleDelay="00:00:05" 					 
                 receiveErrorHandling="Fault"
                        />
      </netMsmqBinding>
    </bindings>
  </system.serviceModel>
</configuration>

설명

포이즌 메시지는 애플리케이션에 전달하려는 반복적인 시도에 실패하는 메시지입니다. 이는 MSMQ(메시지 큐) 기반 바인딩을 사용하는 경우에만 적용됩니다. 기본값은 Fault이며, 기본값으로 설정되면 수신기 및 ServiceHost에 오류를 발생시킵니다. 포이즌 메시지 때문에 서비스에 오류가 발생하는 경우 MsmqPoisonMessageException이 throw됩니다. 이 예외에는 System.Messaging API를 사용하여 메시지를 제거할 때 사용할 수 있는 MSMQ 메시지 LookupId가 포함됩니다. 및 Move 와 같은 Reject 열거형의 ReceiveErrorHandling 특정 값은 Windows Vista에서만 사용할 수 있습니다. ReceiveErrorHandling 속성을 이 열거형의 값 중 하나로 설정하여 포이즌 메시지 처리를 제어합니다.

적용 대상

추가 정보