MessagePropertyFilter 클래스
중요
일부 정보는 릴리스되기 전에 상당 부분 수정될 수 있는 시험판 제품과 관련이 있습니다. Microsoft는 여기에 제공된 정보에 대해 어떠한 명시적이거나 묵시적인 보증도 하지 않습니다.
메시지 큐에서 메시지를 피킹하거나 받을 때 검색되는 속성을 제어하고 선택합니다.
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
설정 된 MessagePropertyFilter 에 MessageQueue 인스턴스 메시지를 받거나 피킹하는 경우 검색 된 속성의 집합을 제어 합니다. 인스턴스의 필터가 설정 됩니다 MessageQueue 메시지 정보를 검색 합니다. 설정 하는 경우는 MessagePropertyFilter 부울 값을 가진 멤버를 false
, 관련 된 정보를 방지 Message 속성에서 검색 되는 MessageQueue합니다.
부울 값 되지 않는 몇 가지 필터 속성이 있습니다. 가져오기 또는 설정의 기본 크기를 정수 값을 Message.Body, Message.Extension, 또는 Message.Label합니다.
제한 된 속성 집합을 검색 합니다. 적은 양의 데이터를 큐에서 전송 되기 때문에 성능 향상에 도움이 됩니다.
속성을 설정할 때 MessagePropertyFilter, 메시지를 받거나 미리 볼 때 해당 속성을 검색 하는지 여부를 나타내는 됩니다. 연결 된 속성 값을 변경 하지 않는 Message합니다.
합니다 MessagePropertyFilter 생성자 설정 모든 필터 속성을 기본값으로, 부울 값에 대 한 false
합니다. 정수 값 속성에 지정 된 기본값 생성자 항목을 참조 하십시오.
Message |
MessagePropertyFilter 클래스의 새 인스턴스를 초기화하고 모든 속성을 기본값으로 설정합니다. |
Acknowledge |
메시지를 받거나 피킹할 때 AcknowledgeType 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Acknowledgment |
메시지를 받거나 피킹할 때 Acknowledgment 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Administration |
메시지를 받거나 피킹할 때 AdministrationQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
App |
메시지를 받거나 피킹할 때 AppSpecific 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Arrived |
메시지를 받거나 피킹할 때 ArrivedTime 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Attach |
메시지를 받거나 피킹할 때 AttachSenderId 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Authenticated |
메시지를 받거나 피킹할 때 Authenticated 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Authentication |
메시지를 받거나 피킹할 때 AuthenticationProviderName 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Authentication |
메시지를 받거나 피킹할 때 AuthenticationProviderType 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Body |
메시지를 받거나 피킹할 때 Body 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Connector |
메시지를 받거나 피킹할 때 ConnectorType 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Correlation |
메시지를 받거나 피킹할 때 CorrelationId 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Default |
기본 본문 버퍼의 크기(바이트)를 가져오거나 설정합니다. |
Default |
기본 확장 버퍼의 크기(바이트)를 가져오거나 설정합니다. |
Default |
기본 레이블 버퍼의 크기(바이트)를 가져오거나 설정합니다. |
Destination |
메시지를 받거나 피킹할 때 DestinationQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Destination |
메시지를 받거나 피킹할 때 DestinationSymmetricKey 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Digital |
메시지를 받거나 피킹할 때 DigitalSignature 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Encryption |
메시지를 받거나 피킹할 때 EncryptionAlgorithm 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Extension |
메시지를 받거나 피킹할 때 Extension 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Hash |
메시지를 받거나 피킹할 때 HashAlgorithm 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Id |
메시지를 받거나 피킹할 때 Id 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Is |
메시지를 받거나 피킹할 때 IsFirstInTransaction 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Is |
메시지를 받거나 피킹할 때 IsLastInTransaction 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Label |
메시지를 받거나 피킹할 때 Label 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Lookup |
메시지를 받거나 피킹할 때 LookupId 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Message |
메시지를 받거나 피킹할 때 MessageType 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Priority |
메시지를 받거나 피킹할 때 Priority 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Recoverable |
메시지를 받거나 피킹할 때 Recoverable 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Response |
메시지를 받거나 피킹할 때 ResponseQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Sender |
메시지를 받거나 피킹할 때 SenderCertificate 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Sender |
메시지를 받거나 피킹할 때 SenderId 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Sender |
메시지를 받거나 피킹할 때 SenderVersion 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Sent |
메시지를 받거나 피킹할 때 SentTime 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Source |
메시지를 받거나 피킹할 때 SourceMachine 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Time |
메시지를 받거나 피킹할 때 TimeToBeReceived 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Time |
메시지를 받거나 피킹할 때 TimeToReachQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Transaction |
메시지를 받거나 피킹할 때 TransactionId 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Transaction |
메시지를 받거나 피킹할 때 TransactionStatusQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Use |
메시지를 받거나 피킹할 때 UseAuthentication 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Use |
메시지를 받거나 피킹할 때 UseDeadLetterQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Use |
메시지를 받거나 피킹할 때 UseEncryption 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Use |
메시지를 받거나 피킹할 때 UseJournalQueue 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Use |
메시지를 받거나 피킹할 때 UseTracing 속성 정보를 검색할지 여부를 나타내는 값을 가져오거나 설정합니다. |
Clear |
부울 필터 값을 |
Clone() |
개체의 부분 복사본을 만듭니다. |
Equals(Object) |
지정된 개체가 현재 개체와 같은지 확인합니다. (다음에서 상속됨 Object) |
Get |
기본 해시 함수로 작동합니다. (다음에서 상속됨 Object) |
Get |
현재 인스턴스의 Type을 가져옵니다. (다음에서 상속됨 Object) |
Memberwise |
현재 Object의 단순 복사본을 만듭니다. (다음에서 상속됨 Object) |
Set |
메시지를 받을 때 모든 메시지 속성을 검색하도록 지정합니다. |
Set |
일반적인 메시지 큐 속성의 필터 값을 |
To |
현재 개체를 나타내는 문자열을 반환합니다. (다음에서 상속됨 Object) |
제품 | 버전 |
---|---|
.NET Framework | 1.1, 2.0, 3.0, 3.5, 4.0, 4.5, 4.5.1, 4.5.2, 4.6, 4.6.1, 4.6.2, 4.7, 4.7.1, 4.7.2, 4.8, 4.8.1 |
.NET 피드백
.NET은(는) 오픈 소스 프로젝트입니다. 다음 링크를 선택하여 피드백을 제공해 주세요.