The Formatter property contains an instance of a formatter object, which transforms messages when your application reads or writes to the queue.
When the application sends message to the queue, the formatter serializes the object into a stream and inserts it into the message body. When reading from a queue, the formatter deserializes the message data into the Body property of a Message.
The XmlMessageFormatter is loosely coupled, so it is not necessary to have the same object type on the sender and receiver when using this format. The ActiveXMessageFormatter and BinaryMessageFormatter serialize the data into binary representation. The ActiveXMessageFormatter is used when sending or receiving COM components.
BinaryMessageFormatter and ActiveXMessageFormatter provide faster throughput than the XmlMessageFormatter. The ActiveXMessageFormatterallows interoperability with Visual Basic 6.0 Message Queuing applications.
When your application sends messages to the queue, the MessageQueue.Formatter applies only to those messages that use the default message properties, DefaultPropertiesToSend. If you send a Message to the queue, Message Queuing uses the formatter defined in the Message.Formatterproperty to serialize the body instead.
The MessageQueue class will always use a Message to receive or peek a message from the queue. The message is deserialized using the MessageQueue.Formatter property.
No comments:
Post a Comment