MsmqBindingBase.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); };
public TimeSpan TimeToLive { get; set; }
member this.TimeToLive : TimeSpan with get, set
Public Property TimeToLive As TimeSpan
属性值
TimeSpan,指示消息在过期之前可以保留在队列中的时间长度。The TimeSpan that indicates how long the messages can be in the queue before they expire. 默认值为 1 天。The default value is 1 day.
注解
设置 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 accessed by the receiving application within the time interval specified is 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.