IMessageFormatter 接口

定义

从“消息队列”消息体序列化或反序列化对象。

public interface class IMessageFormatter : ICloneable
[System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.MessageFormatterConverter))]
public interface IMessageFormatter : ICloneable
[<System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.MessageFormatterConverter))>]
type IMessageFormatter = interface
    interface ICloneable
Public Interface IMessageFormatter
Implements ICloneable
派生
属性
实现

注解

当应用程序使用类的实例将消息发送到队列时 MessageQueue ,格式化程序将 (该对象序列化,该对象可以是) 到流中的任何类的实例,并将其插入消息正文。 当使用从队列进行读取时 MessageQueue ,格式化程序将消息数据反序列化为的 Body 属性 Message

BinaryMessageFormatterActiveXMessageFormatter 相比,提供更快的吞吐量 XmlMessageFormatterActiveXMessageFormatter允许与 Visual Basic 6.0 消息队列应用程序的互操作性。 XmlMessageFormatter是松散耦合的,这意味着服务器和客户端可以对单独发送和接收的类型进行版本保证。

方法

CanRead(Message)

在类中实现时,确定格式化程序是否可以反序列化消息的内容。

Clone()

创建作为当前实例副本的新对象。

(继承自 ICloneable)
Read(Message)

在类中实现时,读取给定消息中的内容并创建包含该消息中的数据的对象。

Write(Message, Object)

在类中实现时,将对象序列化到消息体中。

适用于

另请参阅