Windows apps
Collapse the table of content
Expand the table of content
Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

MsmqBindingElementBase::TimeToLive Property

 

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.

Namespace:   System.ServiceModel.Channels
Assembly:  System.ServiceModel (in System.ServiceModel.dll)

public:
property TimeSpan TimeToLive {
	TimeSpan get();
	void set(TimeSpan value);
}

Property Value

Type: System::TimeSpan

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

Exception Condition
ArgumentOutOfRangeException

The value is less than zero.

ArgumentOutOfRangeException

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

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.

.NET Framework
Available since 3.0
Return to top
Show:
© 2017 Microsoft