Gets or sets a formatter class used to format messages read or written to the message body.
[Visual Basic] Public Property Formatter As IMessageFormatter [C#] public IMessageFormatter Formatter {get; set;} [C++] public: __property IMessageFormatter* get_Formatter(); public: __property void set_Formatter(IMessageFormatter*); [JScript] public function get Formatter() : IMessageFormatter; public function set Formatter(IMessageFormatter);
The IMessageFormatter that represents the way to format objects in the message. The default is SoapMessageFormatter.
The formatter object defines how a message gets transformed into a specific format when it is sent or received by the queue. The Formatter property contains an instance of a formatter object used to read or write to the message body.
If you use the default SoapMessageFormatter, the message is human-readable throughout its life cycle and can be viewed using an XML reader. This allows for a greater level of error handling, as the message can be fixed if a part of it becomes corrupted.
If you use a binary message formatter or the dataset message formatter to write the message, the same formatter is required to read it. Unless you use the original formatter, you will not be able to fix corrupted messages, since the message is not human-readable in the binary or dataset format. However, the binary message formatters provide faster throughput.
When a formatter is used to write to the queue, the Formatter only defines the format for messages that use the default message properties, DefaultPropertiesToSend.
MessageQueue Class | MessageQueue Members | System.Messaging Namespace | SoapMessageFormatter | DataSetMessageFormatter | ActiveXMessageFormatter | BinaryMessageFormatter