MsmqBindingElementBase.TimeToLive Property


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

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 (if available).

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

[ConfigurationPropertyAttribute("timeToLive", DefaultValue = "1.00:00:00")]
public TimeSpan TimeToLive { get; set; }

Property Value

Type: System.TimeSpan

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

Queued applications, by design, work in a disconnected manner, so the sending and receiving applications might not be running at the same time. Therefore, a message sent by the sending application might not be processed immediately by the receiving application. Some messages contain information that is valid only for a particular period of time. If this 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, if no dead-letter queue is available, the message is dropped.

.NET Framework
Available since 3.0
Return to top