Bewerken

Delen via


MsmqBindingElementBase.TimeToLive Property

Definition

Gets or sets a value that specifies how long messages are valid. When this time has elapsed the message is placed in a dead-letter queue depending on the DeadLetterQueue setting.

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

Property Value

A TimeSpan value that specifies how long messages are valid. The default value is 24 hours.

Exceptions

The value is less than zero.

-or-

The value is not infinite and is larger than Int32.MaxValue milliseconds.

Remarks

Queued applications work in a disconnected manner. This means that the sending and receiving applications may not be running at the same time; therefore, a message sent by the sending application may not be processed immediately by the receiving application. Some messages contain information that is valid only for a certain period of time. If such a message is not delivered within that period of time, it no longer contains useful information and should be dropped. This property enables you to specify a time limit for how long a message is kept prior to delivery to the application queue. If this time limit elapses prior to the message being delivered to the application queue, the message is placed in the dead-letter queue if one is available (determined by the DeadLetterQueue property); otherwise, the message is dropped.

Applies to