NetMsmqBinding 클래스

정의

컴퓨터 간 통신에 적합한 큐에 대기 중인 바인딩을 나타냅니다.

public ref class NetMsmqBinding : System::ServiceModel::MsmqBindingBase
public class NetMsmqBinding : System.ServiceModel.MsmqBindingBase
type NetMsmqBinding = class
    inherit MsmqBindingBase
Public Class NetMsmqBinding
Inherits MsmqBindingBase
상속
NetMsmqBinding

예제

다음 예제에서는 바인딩을 사용하도록 NetMsmqBinding 서비스를 구성하는 방법을 보여줍니다.

먼저 구성 파일입니다.

다음으로, 실제 서비스 코드입니다.

// Define a service contract.
[ServiceContract(Namespace="http://Microsoft.ServiceModel.Samples")]
public interface IQueueCalculator
{
    [OperationContract(IsOneWay=true)]
    void Add(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Subtract(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Multiply(double n1, double n2);
    [OperationContract(IsOneWay = true)]
    void Divide(double n1, double n2);
}
' Define a service contract. 
<ServiceContract(Namespace:="http://Microsoft.ServiceModel.Samples")> _
Public Interface IQueueCalculator
    <OperationContract(IsOneWay:=True)> _
    Sub Add(ByVal n1 As Double, ByVal n2 As Double)
    <OperationContract(IsOneWay := True)> _
    Sub Subtract(ByVal n1 As Double, ByVal n2 As Double)
    <OperationContract(IsOneWay := True)> _
    Sub Multiply(ByVal n1 As Double, ByVal n2 As Double)
    <OperationContract(IsOneWay := True)> _
    Sub Divide(ByVal n1 As Double, ByVal n2 As Double)
End Interface
// Service class that implements the service contract.
// Added code to write output to the console window
public class CalculatorService : IQueueCalculator
{
    [OperationBehavior]
    public void Add(double n1, double n2)
    {
        double result = n1 + n2;
        Console.WriteLine("Received Add({0},{1}) - result: {2}", n1, n2, result);
    }

    [OperationBehavior]
    public void Subtract(double n1, double n2)
    {
        double result = n1 - n2;
        Console.WriteLine("Received Subtract({0},{1}) - result: {2}", n1, n2, result);
    }

    [OperationBehavior]
    public void Multiply(double n1, double n2)
    {
        double result = n1 * n2;
        Console.WriteLine("Received Multiply({0},{1}) - result: {2}", n1, n2, result);
    }

    [OperationBehavior]
    public void Divide(double n1, double n2)
    {
        double result = n1 / n2;
        Console.WriteLine("Received Divide({0},{1}) - result: {2}", n1, n2, result);
    }
}
' Service class that implements the service contract.
' Added code to write output to the console window
Public Class CalculatorService
    Implements IQueueCalculator
    <OperationBehavior> _
    Public Sub Add(ByVal n1 As Double, ByVal n2 As Double) Implements IQueueCalculator.Add
        Dim result As Double = n1 + n2
        Console.WriteLine("Received Add({0},{1}) - result: {2}", n1, n2, result)
    End Sub

    <OperationBehavior> _
    Public Sub Subtract(ByVal n1 As Double, ByVal n2 As Double) Implements IQueueCalculator.Subtract
        Dim result As Double = n1 - n2
        Console.WriteLine("Received Subtract({0},{1}) - result: {2}", n1, n2, result)
    End Sub

    <OperationBehavior> _
    Public Sub Multiply(ByVal n1 As Double, ByVal n2 As Double) Implements IQueueCalculator.Multiply
        Dim result As Double = n1 * n2
        Console.WriteLine("Received Multiply({0},{1}) - result: {2}", n1, n2, result)
    End Sub

    <OperationBehavior> _
    Public Sub Divide(ByVal n1 As Double, ByVal n2 As Double) Implements IQueueCalculator.Divide
        Dim result As Double = n1 / n2
        Console.WriteLine("Received Divide({0},{1}) - result: {2}", n1, n2, result)
    End Sub
End Class
// This is the hosting application. This code can appear directly in the service class as well.
class HostApp
{
    // Host the service within this EXE console application.
    public static void Main()
    {
        // Get MSMQ queue name from appsettings in configuration.
        string queueName = ConfigurationManager.AppSettings["queueName"];

        // Create the transacted MSMQ queue if necessary.
        if (!MessageQueue.Exists(queueName))
            MessageQueue.Create(queueName, true);

        // Get the base address that is used to listen for WS-MetaDataExchange requests.
        // This is useful to generate a proxy for the client.
        string baseAddress = ConfigurationManager.AppSettings["baseAddress"];

        // Create a ServiceHost for the CalculatorService type.
        using (ServiceHost serviceHost = new ServiceHost(typeof(CalculatorService), new Uri(baseAddress)))
        {
            // Open the ServiceHostBase to create listeners and start listening for messages.
            serviceHost.Open();

            // The service can now be accessed.
            Console.WriteLine("The service is ready.");
            Console.WriteLine("Press <ENTER> to terminate service.");
            Console.WriteLine();
            Console.ReadLine();

            // Close the ServiceHostBase to shutdown the service.
            serviceHost.Close();
        }
    }
}
' This is the hosting application. This code can appear directly in the service class as well.
Friend Class HostApp
    ' Host the service within this EXE console application.
    Public Shared Sub Main()
        ' Get MSMQ queue name from appsettings in configuration.
        Dim queueName As String = ConfigurationManager.AppSettings("queueName")

        ' Create the transacted MSMQ queue if necessary.
        If (Not MessageQueue.Exists(queueName)) Then
            MessageQueue.Create(queueName, True)
        End If

        ' Get the base address that is used to listen for WS-MetaDataExchange requests.
        ' This is useful to generate a proxy for the client.
        Dim baseAddress As String = ConfigurationManager.AppSettings("baseAddress")

        ' Create a ServiceHost for the CalculatorService type.
        Using serviceHost As New ServiceHost(GetType(CalculatorService), New Uri(baseAddress))
            ' Open the ServiceHostBase to create listeners and start listening for messages.
            serviceHost.Open()

            ' The service can now be accessed.
            Console.WriteLine("The service is ready.")
            Console.WriteLine("Press <ENTER> to terminate service.")
            Console.WriteLine()
            Console.ReadLine()

            ' Close the ServiceHostBase to shutdown the service.
            serviceHost.Close()
        End Using
    End Sub
End Class

설명

바인딩은 NetMsmqBinding MSMQ(메시지 큐)를 전송으로 사용하여 큐에 대한 지원을 제공하고 느슨하게 결합된 애플리케이션, 오류 격리, 부하 평준화 및 연결이 끊긴 작업을 지원할 수 있도록 합니다. 이러한 기능에 대한 자세한 내용은 큐 개요를 참조하세요.

이는 WCF(Windows Communication Foundation)에서 제공하는 시스템 제공 바인딩 중 하나입니다. 구성 값을 서비스로 설정해야 하는 특정 고급 시나리오를 제외하고 구성 값을 사용하여 바인딩을 정의하고 코드 기반 접근 방식을 사용하지 않는 것이 좋습니다.

생성자

Name Description
NetMsmqBinding()

NetMsmqBinding 클래스의 새 인스턴스를 초기화합니다.

NetMsmqBinding(NetMsmqSecurityMode)

지정된 보안 모드를 사용하여 클래스의 NetMsmqBinding 새 인스턴스를 초기화합니다.

NetMsmqBinding(String)

지정된 구성 바인딩 요소의 NetMsmqBinding 설정에서 클래스의 새 인스턴스를 초기화합니다.

속성

Name Description
CloseTimeout

전송에서 예외가 발생하기 전에 연결이 닫히기 위해 제공된 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
CustomDeadLetterQueue

만료되었거나 전송 또는 배달에 실패한 메시지가 배치되는 각 애플리케이션에 대한 배달 못 한 편지 큐의 위치를 포함하는 URI를 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
DeadLetterQueue

사용할 배달 못 한 편지 큐의 형식을 나타내는 열거형 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
Durable

이 바인딩에서 처리된 메시지가 지속성인지 휘발성인지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
EnvelopeVersion

이 바인딩에서 처리하는 메시지에 사용되는 SOAP의 버전을 가져옵니다.

ExactlyOnce

이 바인딩에서 처리된 메시지가 정확히 한 번 수신되는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
MaxBufferPoolSize

채널에서 메시지를 받는 메시지 버퍼 관리자가 사용하도록 할당된 최대 메모리 양을 가져오거나 설정합니다.

MaxReceivedMessageSize

이 바인딩에서 처리되는 메시지의 최대 크기(바이트)를 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
MaxRetryCycles

받는 애플리케이션에 메시지 배달을 시도하는 최대 재시도 주기 수를 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
MessageVersion

바인딩으로 구성된 클라이언트 및 서비스에서 사용하는 메시지 버전을 가져옵니다.

(다음에서 상속됨 Binding)
Name

바인딩의 이름을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
Namespace

바인딩의 XML 네임스페이스를 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
OpenTimeout

전송에서 예외가 발생하기 전에 연결이 열리도록 제공된 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
QueueTransferProtocol

이 바인딩에서 사용하는 대기 중인 통신 채널 전송을 나타내는 열거형 값을 가져오거나 설정합니다.

ReaderQuotas

이 바인딩과 연결된 값을 가져오거나 설정합니다 XmlDictionaryReaderQuotas .

ReceiveContextEnabled

수신 컨텍스트 동작이 요청되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
ReceiveErrorHandling

포이즌 메시지를 처리하는 방법을 지정하는 열거형 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
ReceiveRetryCount

애플리케이션 큐에서 읽은 메시지에 대한 최대 즉시 배달 시도 수를 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
ReceiveTimeout

연결을 끊기 전에 애플리케이션 메시지가 수신되지 않는 동안 연결이 비활성 상태로 유지될 수 있는 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
RetryCycleDelay

즉시 배달할 수 없는 메시지를 배달하려고 할 때 재시도 주기 사이의 시간 지연을 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
Scheme

이 바인딩에 대한 체계를 반환합니다.

(다음에서 상속됨 MsmqBindingBase)
Security

이 바인딩과 연결된 값을 가져오거나 설정합니다 NetMsmqSecurity .

SendTimeout

전송에서 예외가 발생하기 전에 쓰기 작업이 완료될 때까지 제공되는 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 Binding)
TimeToLive

이 바인딩에서 처리하는 메시지가 만료되기 전에 큐에 있을 수 있는 기간을 나타내는 시간 간격을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
UseActiveDirectory

Active Directory를 사용하여 큐 주소를 변환해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

UseMsmqTracing

이 바인딩에서 처리된 메시지를 추적해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
UseSourceJournal

이 바인딩에서 처리된 메시지의 복사본을 원본 저널 큐에 저장할지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)
ValidityDuration

수신 컨텍스트 기능에서 메시지를 잠글 기간을 지정하는 값을 가져오거나 설정합니다.

(다음에서 상속됨 MsmqBindingBase)

메서드

Name Description
BuildChannelFactory<TChannel>(BindingParameterCollection)

지정된 유형의 채널을 만들고 바인딩 매개 변수 컬렉션에서 지정한 기능을 충족하는 채널 팩터리 스택을 클라이언트에 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelFactory<TChannel>(Object[])

지정된 유형의 채널을 만들고 개체 배열에서 지정한 기능을 충족하는 채널 팩터리 스택을 클라이언트에 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(BindingParameterCollection)

지정된 유형의 채널을 허용하고 바인딩 매개 변수 컬렉션에서 지정한 기능을 충족하는 서비스에 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, BindingParameterCollection)

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, ListenUriMode, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
BuildChannelListener<TChannel>(Uri, String, Object[])

지정된 유형의 채널을 허용하고 지정된 기능을 충족하는 서비스에서 채널 수신기를 빌드합니다.

(다음에서 상속됨 Binding)
CanBuildChannelFactory<TChannel>(BindingParameterCollection)

현재 바인딩이 지정된 바인딩 매개 변수 컬렉션을 충족하는 채널 팩터리 스택을 클라이언트에 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelFactory<TChannel>(Object[])

현재 바인딩이 개체 배열에서 지정한 요구 사항을 충족하는 채널 팩터리 스택을 클라이언트에 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelListener<TChannel>(BindingParameterCollection)

현재 바인딩이 지정된 바인딩 매개 변수 컬렉션을 충족하는 서비스에서 채널 수신기 스택을 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CanBuildChannelListener<TChannel>(Object[])

현재 바인딩이 개체 배열에 지정된 조건을 충족하는 서비스에서 채널 수신기 스택을 빌드할 수 있는지 여부를 나타내는 값을 반환합니다.

(다음에서 상속됨 Binding)
CreateBindingElements()

현재 바인딩에 포함된 바인딩 요소의 순서가 지정된 컬렉션을 반환합니다.

Equals(Object)

지정된 개체가 현재 개체와 같은지 여부를 확인합니다.

(다음에서 상속됨 Object)
GetHashCode()

기본 해시 함수로 사용됩니다.

(다음에서 상속됨 Object)
GetProperty<T>(BindingParameterCollection)

바인딩 스택의 적절한 계층에서 요청된 형식화된 개체(있는 경우)를 반환합니다.

(다음에서 상속됨 Binding)
GetType()

현재 인스턴스의 Type 가져옵니다.

(다음에서 상속됨 Object)
MemberwiseClone()

현재 Object단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
ShouldSerializeName()

바인딩의 이름을 serialize해야 하는지 여부를 반환합니다.

(다음에서 상속됨 Binding)
ShouldSerializeNamespace()

바인딩의 네임스페이스를 serialize해야 하는지 여부를 반환합니다.

(다음에서 상속됨 Binding)
ShouldSerializeReaderQuotas()

속성이 기본값에서 변경되어 serialize되어야 하는지 여부를 ReaderQuotas 나타내는 값을 반환합니다.

ShouldSerializeSecurity()

속성이 기본값에서 변경되어 serialize되어야 하는지 여부를 Security 나타내는 값을 반환합니다.

ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)

명시적 인터페이스 구현

Name Description
IBindingRuntimePreferences.ReceiveSynchronously

들어오는 요청을 동기적으로 또는 비동기적으로 보다 효율적으로 처리할 수 있는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 MsmqBindingBase)

적용 대상