Edit

Share via


Message.TimeToBeReceived Property

Definition

Gets or sets the maximum amount of time for the message to be received from the destination queue.

public:
 property TimeSpan TimeToBeReceived { TimeSpan get(); void set(TimeSpan value); };
[System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.TimeoutConverter))]
[System.Messaging.MessagingDescription("MsgTimeToBeReceived")]
public TimeSpan TimeToBeReceived { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.TimeoutConverter))>]
[<System.Messaging.MessagingDescription("MsgTimeToBeReceived")>]
member this.TimeToBeReceived : TimeSpan with get, set
Public Property TimeToBeReceived As TimeSpan

Property Value

The total time for a sent message to be received from the destination queue. The default is InfiniteTimeout.

Attributes

Exceptions

The message queue is filtered to ignore the TimeToBeReceived property.

The value specified for TimeToBeReceived is invalid.

Examples

The following code example gets and sets the value of a message's TimeToBeReceived property.

Remarks

The TimeToBeReceived property specifies the total time for a sent message to be received from the destination queue. The time limit includes the time spent getting to the destination queue and the time spent waiting in the queue before the message is received.

Caution

When using dependent client computers, be sure the clock on the client computer is synchronized with the clock on the server that is running Message Queuing. Otherwise, unpredictable behavior might result when sending a message whose TimeToBeReceived property is not InfiniteTimeout.

If the interval specified by the TimeToBeReceived property expires before the message is removed from the queue, Message Queuing discards the message in one of two ways. If the message's UseDeadLetterQueue property is true, the message is sent to the dead-letter queue. If UseDeadLetterQueue is false, the message is ignored.

You can set the message's AcknowledgeType property to request that Message Queuing send a negative acknowledgment message back to the sending application if the message is not retrieved before the timer expires.

If the value specified by the TimeToBeReceived property is less than the value specified by the TimeToReachQueue property, TimeToBeReceived takes precedence.

When several messages are sent in a single transaction, Message Queuing uses the TimeToBeReceived property of the first message.

Applies to

See also