銷售: 1-800-867-1380

TimeToLive 屬性

取得或設定訊息的存留時間值。這是從將訊息傳送給服務匯流排開始起算的期間,在此期間之後,訊息會過期。

比其 TimeToLive 值還舊的訊息會過期,而且不再保留於訊息存放區中。訂閱者將無法接收過期訊息。

TimeToLive 是訊息可以接收的最大存留期,但該值不能超過目的地佇列或訂閱上實體指定的 DefaultMessageTimeToLive 值。如果指定較低的 TimeToLive 值,則會套用到個別的訊息。不過,在訊息上指定的較大值會由實體的 DefaultMessageTimeToLive 值加以覆寫。

命名空間:  Microsoft.ServiceBus.Messaging
組件:  Microsoft.ServiceBus (在 Microsoft.ServiceBus.dll 中)

public TimeSpan TimeToLive { get; set; }

屬性值

型別:System..::..TimeSpan
訊息的存留時間值。

例外狀況條件
ObjectDisposedException

在訊息處於已處置狀態時擲回。

ArgumentOutOfRangeException

在傳入的值小於或等於 TimeSpan.Zero 時擲回。

The message will be moved to the dead letter queue at TTL expiry if dead lettering is enabled. Otherwise, the message will be discarded from the system. See EnableDeadLetteringOnMessageExpiration and EnableDeadLetteringOnMessageExpiration to learn more about how to control dead lettering setting for Queues and Subscriptions respectively.

If the TTL set on a message by the sender exceeds the destination's TTL, then the message's TTL will be overwritten by the later value. See DefaultMessageTimeToLive, DefaultMessageTimeToLive and DefaultMessageTimeToLive to learn more about how to control message TTL at an entity level.

If there are no receive operations on a queue or subscription, the MessageCount property may include messages for which TimeToLive has expired. When a receive operation is called on the queue, the expired messages will not be delivered and the MessageCount property will be updated appropriately.

There is no minimum or maximum bound on TimeToLive.

本文對您有任何幫助嗎?
(剩餘 1500 個字元)
感謝您提供意見

社群新增項目

新增
顯示:
© 2014 Microsoft