MsmqElementBase.TimeToLive 属性

定义

获取或设置一个时间间隔,该时间间隔指示此绑定处理的消息在过期之前可以保留在队列中的时间长度。Gets or sets the interval of time that indicates how long the messages processed by this binding can be in the queue before they expire.

public:
 property TimeSpan TimeToLive { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.ServiceModel.TimeSpanOrInfiniteConverter))]
[System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
public TimeSpan TimeToLive { get; set; }
[System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.ComponentModel.TypeConverter(typeof(System.Runtime.TimeSpanOrInfiniteConverter))]
public TimeSpan TimeToLive { get; set; }
[System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)]
[System.ComponentModel.TypeConverter(typeof(System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter))]
public TimeSpan TimeToLive { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.ServiceModel.TimeSpanOrInfiniteConverter))>]
[<System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
member this.TimeToLive : TimeSpan with get, set
[<System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.ComponentModel.TypeConverter(typeof(System.Runtime.TimeSpanOrInfiniteConverter))>]
member this.TimeToLive : TimeSpan with get, set
[<System.Configuration.ConfigurationProperty("timeToLive", DefaultValue=Mono.Cecil.CustomAttributeArgument)>]
[<System.ComponentModel.TypeConverter(typeof(System.ServiceModel.Configuration.TimeSpanOrInfiniteConverter))>]
member this.TimeToLive : TimeSpan with get, set
Public Property TimeToLive As TimeSpan

属性值

TimeSpan

TimeSpan,指示消息在过期之前可以保留在队列中的时间长度。The TimeSpan that indicates how long the messages can be in the queue before they expire. 默认值为一天 (01:00:00:00)。The default value is one day (01:00:00:00).

属性

注解

设置 TimeToLive 属性可以确保具有时效性的消息不会在由接收应用程序进行处理之前过时。The TimeToLive property is set to ensure that time-sensitive messages do not become stale before they are processed by the receiving applications. 如果队列中的消息在指定时间间隔内未被接收应用程序进行处理,则称该消息为过时消息。A message in a queue that is not consumed by the receiving application within the time interval specified is said to be expired. 过期消息将发送到一个称为死信队列的特殊队列中。Expired messages are sent to a special queue called the dead-letter queue. 死信队列的位置通过 DeadLetterQueue 属性进行设置,或基于保证设置为适当的默认值。The location of the dead-letter queue is set with the DeadLetterQueue property or to the appropriate default, based on assurances.

适用于