MsmqBindingElementBase.ReceiveContextEnabled 属性

定义

获取或设置一个值,该值指示是否启用了用于处理队列中的消息的接收上下文。

public:
 property bool ReceiveContextEnabled { bool get(); void set(bool value); };
[System.Configuration.ConfigurationProperty("receiveContextEnabled", DefaultValue=true)]
public bool ReceiveContextEnabled { get; set; }
[<System.Configuration.ConfigurationProperty("receiveContextEnabled", DefaultValue=true)>]
member this.ReceiveContextEnabled : bool with get, set
Public Property ReceiveContextEnabled As Boolean

属性值

如果启用了用于处理队列中的消息的接收上下文,则为 .

属性

注解

启用此功能后,服务可以“查看”队列上的消息以开始处理它,如果出现任何错误并且引发异常,它将保留在队列中。 服务还可以“锁定”消息,以便在以后的某个时间点重试处理。 ReceiveContext 提供一种机制,用于在处理消息后“完成”消息,以便从队列中删除它。 消息不再通过网络读取和重新写入队列,在处理过程中,单个消息不会在不同的服务实例上跳动。

适用于