Export (0) Print
Expand All

Message.MessageType Property

Gets the message type: Normal, Acknowledgment, or Report.

Namespace:  System.Messaging
Assembly:  System.Messaging (in System.Messaging.dll)

[MessagingDescriptionAttribute("MsgMessageType")]
public MessageType MessageType { get; }

Property Value

Type: System.Messaging.MessageType
One of the MessageType values.

ExceptionCondition
InvalidOperationException

The message has not been sent. This property can only be read on messages retrieved from a queue.

-or-

The message queue is filtered to ignore the MessageType property.

Message Queuing typically sets this property when it sends the message. A Message Queuing message can be one of the following types:

  • Normal, which is either a typical message sent from an application to a queue, or a response message returned to the sending application.

  • Acknowledgement, which Message Queuing generates whenever the sending application requests one. For example, Message Queuing can generate positive or negative messages to indicate that the original message arrived or was read. Message Queuing returns the appropriate acknowledgment message to the administration queue specified by the sending application.

  • Report, which Message Queuing generates whenever a report queue is defined at the source Queue Manager. When tracing is enabled, Message Queuing sends a report message to the Message Queuing report queue each time the original message enters or leaves a Message Queuing server.

The following code example displays the value of a message's MessageType property.

// Display the value of the message's MessageType property.
Console.WriteLine("Message Type: {0}", orderMessage.MessageType);

.NET Framework

Supported in: 4.5.3, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

Was this page helpful?
(1500 characters remaining)
Thank you for your feedback
Show:
© 2014 Microsoft