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
특성
구현

예제

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


#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

설명

설정 된 MessagePropertyFilterMessageQueue 인스턴스 메시지를 받거나 피킹하는 경우 검색 된 속성의 집합을 제어 합니다. 인스턴스의 필터가 설정 됩니다 MessageQueue 메시지 정보를 검색 합니다. 설정 하는 경우는 MessagePropertyFilter 부울 값을 가진 멤버를 false, 관련 된 정보를 방지 Message 속성에서 검색 되는 MessageQueue합니다.

부울 값 되지 않는 몇 가지 필터 속성이 있습니다. 가져오기 또는 설정의 기본 크기를 정수 값을 Message.Body, Message.Extension, 또는 Message.Label합니다.

제한 된 속성 집합을 검색 합니다. 적은 양의 데이터를 큐에서 전송 되기 때문에 성능 향상에 도움이 됩니다.

속성을 설정할 때 MessagePropertyFilter, 메시지를 받거나 미리 볼 때 해당 속성을 검색 하는지 여부를 나타내는 됩니다. 연결 된 속성 값을 변경 하지 않는 Message합니다.

합니다 MessagePropertyFilter 생성자 설정 모든 필터 속성을 기본값으로, 부울 값에 대 한 false합니다. 정수 값 속성에 지정 된 기본값 생성자 항목을 참조 하십시오.

생성자

MessagePropertyFilter()

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

속성

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 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다.

메서드

ClearAll()

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

Clone()

개체의 부분 복사본을 만듭니다.

Equals(Object)

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

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

기본 해시 함수로 작동합니다.

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

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

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

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

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

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

SetDefaults()

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

ToString()

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

(다음에서 상속됨 Object)

적용 대상

추가 정보