DefaultPropertiesToSend.TimeToBeReceived 属性

定义

获取或设置从目标队列中检索消息的时间限制。Gets or sets the time limit for the message to be retrieved 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.Messaging.MessagingDescription("MsgTimeToBeReceived")]
[System.ComponentModel.TypeConverter(typeof(System.Messaging.TimeoutConverter))]
public TimeSpan TimeToBeReceived { get; set; }
[<System.ComponentModel.TypeConverter(typeof(System.Messaging.Design.TimeoutConverter))>]
[<System.Messaging.MessagingDescription("MsgTimeToBeReceived")>]
member this.TimeToBeReceived : TimeSpan with get, set
[<System.Messaging.MessagingDescription("MsgTimeToBeReceived")>]
[<System.ComponentModel.TypeConverter(typeof(System.Messaging.TimeoutConverter))>]
member this.TimeToBeReceived : TimeSpan with get, set
Public Property TimeToBeReceived As TimeSpan

属性值

TimeSpan

从目标队列中接收已发送消息的总时间(以秒计)。The total time, in seconds, for a sent message to be received from the destination queue. 默认值为 InfiniteTimeoutThe default is InfiniteTimeout.

属性

注解

TimeToBeReceived属性指定从目标队列接收发送的消息的总时间(以秒为单位)。The TimeToBeReceived property specifies the total time in seconds for a sent message to be received from the destination queue. 此时间限制包括进入目标队列所用的时间,以及应用程序检索消息之前在队列中等待的时间。This time limit includes the time spent getting to the destination queue, plus the time spent waiting in the queue before the message is retrieved by an application.

注意

使用从属客户端计算机时,请将客户端计算机上的时钟与运行消息队列的服务器上的时钟同步。When using dependent client computers, synchronize the clock on the client computer with the clock on the server running Message Queuing. 如果两个时钟不同步,则当不是时发送消息时,可能会出现不可预知的行为 TimeToBeReceived InfiniteTimeoutIf the two clocks are not synchronized, you might see unpredictable behavior when sending messages when TimeToBeReceived is not InfiniteTimeout.

如果 TimeToBeReceived 从队列中删除消息之前该间隔过期,则消息队列应用程序将丢弃该消息。If the TimeToBeReceived interval expires before the message is removed from the queue, the Message Queuing application discards the message. 如果消息的 UseDeadLetterQueue 属性设置为 true ,或者如果为,则将消息发送到死信队列 UseDeadLetterQueue falseThe message is either sent to the dead-letter queue, if the message's UseDeadLetterQueue property is set to true, or ignored, if UseDeadLetterQueue is false. 如果 TimeToBeReceived 小于,则 TimeToReachQueue TimeToBeReceived 优先。If TimeToBeReceived is less than TimeToReachQueue, TimeToBeReceived takes precedence.

AcknowledgeType如果在计时器过期之前未检索到消息,则可以将消息的属性设置为请求消息队列向发送应用程序发送否定确认消息。The message's AcknowledgeType property can be set 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.

注意

如果你指定接收 TimeToReachQueue 否定确认,则当的值小于的值时,将不会收到这些确认 TimeToBeReceived TimeToReachQueueIf you have specified to receive TimeToReachQueue negative acknowledgments, you will not receive them when the value of TimeToBeReceived is less than the value of TimeToReachQueue.

当在事务中发送多条消息时,消息队列将使用第一条消息的 TimeToBeReceived 属性的值。When several messages are sent in a transaction, Message Queuing uses the value of the first message's TimeToBeReceived property.

适用于

另请参阅