Det här innehållet finns inte tillgängligt på ditt språk men här finns den engelska versionen,

BrokeredMessage.TimeToLive Property


Gets or sets the message’s time to live value. This is the duration after which the message expires, starting from when the message is sent to the Service Bus. Messages older than their TimeToLive value will expire and no longer be retained in the message store. Subscribers will be unable to receive expired messages.TimeToLive is the maximum lifetime that a message can receive, but its value cannot exceed the entity specified the DefaultMessageTimeToLive value on the destination queue or subscription. If a lower TimeToLive value is specified, it will be applied to the individual message. However, a larger value specified on the message will be overridden by the entity’s DefaultMessageTimeToLive value.

Namespace:   Microsoft.ServiceBus.Messaging
Assembly:  Microsoft.ServiceBus (in Microsoft.ServiceBus.dll)

public TimeSpan TimeToLive { get; set; }

Property Value

Type: System.TimeSpan

The message’s time to live value.

Exception Condition

Thrown if the message is in disposed state.


Thrown if the passed in value is less than or equal to TimeSpan.Zero.

Return to top