MessagePropertyFilter 클래스

정의

메시지 큐에서 메시지를 피킹하거나 받을 때 검색되는 속성을 제어하고 선택합니다.

public ref class MessagePropertyFilter
public ref class MessagePropertyFilter : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class MessagePropertyFilter
[System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))]
public class MessagePropertyFilter : ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))>]
type MessagePropertyFilter = class
[<System.ComponentModel.TypeConverter(typeof(System.ComponentModel.ExpandableObjectConverter))>]
type MessagePropertyFilter = class
    interface ICloneable
Public Class MessagePropertyFilter
Public Class MessagePropertyFilter
Implements ICloneable
상속
MessagePropertyFilter
특성
구현

예제

다음 코드 예제에서는 서로 다른 우선 순위의 두 메시지를 큐에 보내고 이후에 검색합니다.


#using <system.dll>
#using <system.messaging.dll>

using namespace System;
using namespace System::Messaging;

/// <summary>
/// Provides a container class for the example.
/// </summary>
ref class MyNewQueue
{
   //**************************************************
   // Sends a string message to a queue.
   //**************************************************
public:
   void SendMessage( MessagePriority priority, String^ messageBody )
   {
      // Connect to a queue on the local computer.
      MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );

      // Create a new message.
      Message^ myMessage = gcnew Message;
      if ( priority > MessagePriority::Normal )
      {
         myMessage->Body = "High Priority: {0}",messageBody;
      }
      else
      {
         myMessage->Body = messageBody;
      }

      // Set the priority of the message.
      myMessage->Priority = priority;

      // Send the Order to the queue.
      myQueue->Send( myMessage );

      return;
   }

   //**************************************************
   // Receives a message.
   //**************************************************
   void ReceiveMessage()
   {
      // Connect to the a queue on the local computer.
      MessageQueue^ myQueue = gcnew MessageQueue( ".\\myQueue" );

      // Set the queue to read the priority. By default, it
      // is not read.
      myQueue->MessageReadPropertyFilter->Priority = true;

      // Set the formatter to indicate body contains a String^.
      array<Type^>^ p = gcnew array<Type^>(1);
      p[ 0 ] = String::typeid;
      myQueue->Formatter = gcnew XmlMessageFormatter( p );
      try
      {
         // Receive and format the message. 
         Message^ myMessage = myQueue->Receive();

         // Display message information.
         Console::WriteLine( "Priority: {0}",
            myMessage->Priority );
         Console::WriteLine( "Body: {0}",
            myMessage->Body );
      }
      catch ( MessageQueueException^ ) 
      {
         // Handle Message Queuing exceptions.
      }
      // Handle invalid serialization format.
      catch ( InvalidOperationException^ e ) 
      {
         Console::WriteLine( e->Message );
      }

      // Catch other exceptions as necessary.

      return;
   }
};

//**************************************************
// Provides an entry point into the application.
//		 
// This example sends and receives a message from
// a queue.
//**************************************************
int main()
{
   // Create a new instance of the class.
   MyNewQueue^ myNewQueue = gcnew MyNewQueue;

   // Send messages to a queue.
   myNewQueue->SendMessage( MessagePriority::Normal, "First Message Body." );
   myNewQueue->SendMessage( MessagePriority::Highest, "Second Message Body." );

   // Receive messages from a queue.
   myNewQueue->ReceiveMessage();
   myNewQueue->ReceiveMessage();

   return 0;
}
using System;
using System.Messaging;

namespace MyProject
{

    /// <summary>
    /// Provides a container class for the example.
    /// </summary>
    public class MyNewQueue
    {

        //**************************************************
        // Provides an entry point into the application.
        //		
        // This example sends and receives a message from
        // a queue.
        //**************************************************

        public static void Main()
        {
            // Create a new instance of the class.
            MyNewQueue myNewQueue = new MyNewQueue();

            // Send messages to a queue.
            myNewQueue.SendMessage(MessagePriority.Normal, "First Message Body.");
            myNewQueue.SendMessage(MessagePriority.Highest, "Second Message Body.");

            // Receive messages from a queue.
            myNewQueue.ReceiveMessage();
            myNewQueue.ReceiveMessage();

            return;
        }

        //**************************************************
        // Sends a string message to a queue.
        //**************************************************
        
        public void SendMessage(MessagePriority priority, string messageBody)
        {

            // Connect to a queue on the local computer.
            MessageQueue myQueue = new MessageQueue(".\\myQueue");

            // Create a new message.
            Message myMessage = new Message();

            if(priority > MessagePriority.Normal)
            {
                myMessage.Body = "High Priority: " + messageBody;
            }
            else
            {
                myMessage.Body = messageBody;
            }

            // Set the priority of the message.
            myMessage.Priority = priority;

            // Send the Order to the queue.
            myQueue.Send(myMessage);

            return;
        }

        //**************************************************
        // Receives a message.
        //**************************************************
        
        public  void ReceiveMessage()
        {
            // Connect to the a queue on the local computer.
            MessageQueue myQueue = new MessageQueue(".\\myQueue");

            // Set the queue to read the priority. By default, it
            // is not read.
            myQueue.MessageReadPropertyFilter.Priority = true;

            // Set the formatter to indicate body contains a string.
            myQueue.Formatter = new XmlMessageFormatter(new Type[]
                {typeof(string)});
            
            try
            {
                // Receive and format the message.
                Message myMessage =	myQueue.Receive();

                // Display message information.
                Console.WriteLine("Priority: " +
                    myMessage.Priority.ToString());
                Console.WriteLine("Body: " +
                    myMessage.Body.ToString());
            }
            
            catch (MessageQueueException)
            {
                // Handle Message Queuing exceptions.
            }

            // Handle invalid serialization format.
            catch (InvalidOperationException e)
            {
                Console.WriteLine(e.Message);
            }
            
            // Catch other exceptions as necessary.

            return;
        }
    }
}
Imports System.Messaging


'Provides a container class for the example.
Public Class MyNewQueue
      
      

      ' Provides an entry point into the application.
      '		 
      ' This example sends and receives a message from
      ' a queue.

      Public Shared Sub Main()
         ' Create a new instance of the class.
         Dim myNewQueue As New MyNewQueue()
         
         ' Send messages to a queue.
         myNewQueue.SendMessage(MessagePriority.Normal, "First Message Body.")
         myNewQueue.SendMessage(MessagePriority.Highest, "Second Message Body.")
         
         ' Receive messages from a queue.
         myNewQueue.ReceiveMessage()
         myNewQueue.ReceiveMessage()
         
         Return
      End Sub
      
      
      

      ' Sends a string message to a queue.

      Public Sub SendMessage(priority As MessagePriority, messageBody As String)
         
         ' Connect to a queue on the local computer.
         Dim myQueue As New MessageQueue(".\myQueue")
         
         ' Create a new message.
         Dim myMessage As New Message()
         
         If priority > MessagePriority.Normal Then
            myMessage.Body = "High Priority: " + messageBody
         Else
            myMessage.Body = messageBody
         End If 
         ' Set the priority of the message.
         myMessage.Priority = priority
         
         
         ' Send the Order to the queue.
         myQueue.Send(myMessage)
         
         Return
      End Sub
      
      
      

      ' Receives a message.

      Public Sub ReceiveMessage()
         ' Connect to the a queue on the local computer.
         Dim myQueue As New MessageQueue(".\myQueue")
         
         ' Set the queue to read the priority. By default, it
         ' is not read.
         myQueue.MessageReadPropertyFilter.Priority = True
         
         ' Set the formatter to indicate body contains a string.
         myQueue.Formatter = New XmlMessageFormatter(New Type() {GetType(String)})
         
         Try
            ' Receive and format the message. 
            Dim myMessage As Message = myQueue.Receive()
            
            ' Display message information.
            Console.WriteLine(("Priority: " + myMessage.Priority.ToString()))
            Console.WriteLine(("Body: " + myMessage.Body.ToString()))
         
         
         
         ' Handle invalid serialization format.
         Catch e As InvalidOperationException
            Console.WriteLine(e.Message)
         End Try
         
         ' Catch other exceptions as necessary.
         Return
      End Sub
   End Class

설명

인스턴스에서 MessageQueue 설정하면 MessagePropertyFilter 메시지를 피킹하거나 받을 때 검색되는 속성 집합이 제어됩니다. 필터는 메시지 정보를 검색하는 인스턴스 MessageQueue 에 설정됩니다. 부울 반환 멤버falseMessagePropertyFilter 설정하면 연결된 Message 속성의 정보가 에 의해 MessageQueue검색되지 않도록 합니다.

부울 값이 아닌 몇 가지 필터 속성이 있습니다. 이 값 Message.Body은 , Message.Extension또는 Message.Label.

제한된 속성 집합을 검색하면 적은 양의 데이터가 큐에서 전송되므로 성능이 향상됩니다.

속성을 MessagePropertyFilter설정할 때 메시지를 받거나 피킹할 때 해당 속성이 검색되는지 여부만 나타냅니다. 에 대한 Message연결된 속성 값을 변경하지 않습니다.

MessagePropertyFilter 생성자는 모든 필터 속성을 부울 false값의 기본값으로 설정합니다. 정수 값 속성에 할당된 기본값은 생성자 항목을 참조하세요.

생성자

Name Description
MessagePropertyFilter()

클래스의 새 인스턴스를 MessagePropertyFilter 초기화하고 모든 속성에 대한 기본값을 설정합니다.

속성

Name Description
AcknowledgeType

메시지를 받거나 피킹할 때 속성 정보를 검색 AcknowledgeType 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Acknowledgment

메시지를 받거나 피킹할 때 속성 정보를 검색 Acknowledgment 할지 여부를 나타내는 값을 가져오거나 설정합니다.

AdministrationQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 AdministrationQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

AppSpecific

메시지를 받거나 피킹할 때 속성 정보를 검색 AppSpecific 할지 여부를 나타내는 값을 가져오거나 설정합니다.

ArrivedTime

메시지를 받거나 피킹할 때 속성 정보를 검색 ArrivedTime 할지 여부를 나타내는 값을 가져오거나 설정합니다.

AttachSenderId

메시지를 받거나 피킹할 때 속성 정보를 검색 AttachSenderId 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Authenticated

메시지를 받거나 피킹할 때 속성 정보를 검색 Authenticated 할지 여부를 나타내는 값을 가져오거나 설정합니다.

AuthenticationProviderName

메시지를 받거나 피킹할 때 속성 정보를 검색 AuthenticationProviderName 할지 여부를 나타내는 값을 가져오거나 설정합니다.

AuthenticationProviderType

메시지를 받거나 피킹할 때 속성 정보를 검색 AuthenticationProviderType 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Body

메시지를 받거나 피킹할 때 속성 정보를 검색 Body 할지 여부를 나타내는 값을 가져오거나 설정합니다.

ConnectorType

메시지를 받거나 피킹할 때 속성 정보를 검색 ConnectorType 할지 여부를 나타내는 값을 가져오거나 설정합니다.

CorrelationId

메시지를 받거나 피킹할 때 속성 정보를 검색 CorrelationId 할지 여부를 나타내는 값을 가져오거나 설정합니다.

DefaultBodySize

기본 본문 버퍼의 크기(바이트)를 가져오거나 설정합니다.

DefaultExtensionSize

기본 확장 버퍼의 크기(바이트)를 가져오거나 설정합니다.

DefaultLabelSize

기본 레이블 버퍼의 크기(바이트)를 가져오거나 설정합니다.

DestinationQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 DestinationQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

DestinationSymmetricKey

메시지를 받거나 피킹할 때 속성 정보를 검색 DestinationSymmetricKey 할지 여부를 나타내는 값을 가져오거나 설정합니다.

DigitalSignature

메시지를 받거나 피킹할 때 속성 정보를 검색 DigitalSignature 할지 여부를 나타내는 값을 가져오거나 설정합니다.

EncryptionAlgorithm

메시지를 받거나 피킹할 때 속성 정보를 검색 EncryptionAlgorithm 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Extension

메시지를 받거나 피킹할 때 속성 정보를 검색 Extension 할지 여부를 나타내는 값을 가져오거나 설정합니다.

HashAlgorithm

메시지를 받거나 피킹할 때 속성 정보를 검색 HashAlgorithm 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Id

메시지를 받거나 피킹할 때 속성 정보를 검색 Id 할지 여부를 나타내는 값을 가져오거나 설정합니다.

IsFirstInTransaction

메시지를 받거나 피킹할 때 속성 정보를 검색 IsFirstInTransaction 할지 여부를 나타내는 값을 가져오거나 설정합니다.

IsLastInTransaction

메시지를 받거나 피킹할 때 속성 정보를 검색 IsLastInTransaction 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Label

메시지를 받거나 피킹할 때 속성 정보를 검색 Label 할지 여부를 나타내는 값을 가져오거나 설정합니다.

LookupId

메시지를 받거나 피킹할 때 속성 정보를 검색 LookupId 할지 여부를 나타내는 값을 가져오거나 설정합니다.

MessageType

메시지를 받거나 피킹할 때 속성 정보를 검색 MessageType 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Priority

메시지를 받거나 피킹할 때 속성 정보를 검색 Priority 할지 여부를 나타내는 값을 가져오거나 설정합니다.

Recoverable

메시지를 받거나 피킹할 때 속성 정보를 검색 Recoverable 할지 여부를 나타내는 값을 가져오거나 설정합니다.

ResponseQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 ResponseQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

SenderCertificate

메시지를 받거나 피킹할 때 속성 정보를 검색 SenderCertificate 할지 여부를 나타내는 값을 가져오거나 설정합니다.

SenderId

메시지를 받거나 피킹할 때 속성 정보를 검색 SenderId 할지 여부를 나타내는 값을 가져오거나 설정합니다.

SenderVersion

메시지를 받거나 피킹할 때 속성 정보를 검색 SenderVersion 할지 여부를 나타내는 값을 가져오거나 설정합니다.

SentTime

메시지를 받거나 피킹할 때 속성 정보를 검색 SentTime 할지 여부를 나타내는 값을 가져오거나 설정합니다.

SourceMachine

메시지를 받거나 피킹할 때 속성 정보를 검색 SourceMachine 할지 여부를 나타내는 값을 가져오거나 설정합니다.

TimeToBeReceived

메시지를 받거나 피킹할 때 속성 정보를 검색 TimeToBeReceived 할지 여부를 나타내는 값을 가져오거나 설정합니다.

TimeToReachQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 TimeToReachQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

TransactionId

메시지를 받거나 피킹할 때 속성 정보를 검색 TransactionId 할지 여부를 나타내는 값을 가져오거나 설정합니다.

TransactionStatusQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 TransactionStatusQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

UseAuthentication

메시지를 받거나 피킹할 때 속성 정보를 검색 UseAuthentication 할지 여부를 나타내는 값을 가져오거나 설정합니다.

UseDeadLetterQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 UseDeadLetterQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

UseEncryption

메시지를 받거나 피킹할 때 속성 정보를 검색 UseEncryption 할지 여부를 나타내는 값을 가져오거나 설정합니다.

UseJournalQueue

메시지를 받거나 피킹할 때 속성 정보를 검색 UseJournalQueue 할지 여부를 나타내는 값을 가져오거나 설정합니다.

UseTracing

메시지를 받거나 피킹할 때 속성 정보를 검색 UseTracing 할지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

Name Description
ClearAll()

메시지를 받을 때 메시지 속성이 검색되지 않도록 모든 부울 필터 값을 false로 설정합니다.

Clone()

개체의 단순 복사본을 만듭니다.

Equals(Object)

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

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

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

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

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

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

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

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

메시지를 받을 때 모든 메시지 속성을 검색하도록 지정합니다.

SetDefaults()

일반적인 메시지 큐 속성 true 의 필터 값을 설정하고 정수 값 속성을 기본값으로 설정합니다.

ToString()

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

(다음에서 상속됨 Object)

적용 대상

추가 정보