The MaxTimeToReachQueue property of the MSMQMessage object specifies a time limit (in seconds) for the message to reach the queue.
Property MaxTimeToReachQueue As Long
An integer value (the default is the enterprise-wide setting for the time-to-reach-queue interval).
MaxTimeToReachQueue is used to set the message's time-to-reach-queue timer. For a discussion of message timers, see Message Timers. If the time-to-reach-queue interval elapses before the message reaches its destination, Message Queuing discards the message, sending it to the dead-letter queue if the message's MSMQMessage.Journal property is set to MQMSG_DEADLETTER.
Message Queuing can also send a return negative acknowledgment message back to the sending application if the message does not arrive and the message's MSMQMessage.Ack property is set accordingly.
If this property is not set or if this property is set to LONG_LIVED or INFINITE, Message Queuing uses the enterprise-wide setting for the time-to-reach-queue interval.
This enterprise-wide setting can be adjusted by the MSMQ Administrator. By default, this setting equals 4 days for messages sent from the following types of computers:
Computers running MSMQ 3.0 in workgroup mode.
Clients running MSMQ 3.0 that belong to a completely new domain.
Clients running MSMQ 3.0 that join an existing domain provided weakened security was not enabled for that forest.
The default enterprise-wide setting for messages sent from any computer in a migrated enterprise and computers running MSMQ 1.0 or MSMQ 2 in and enterprises is 90 days.
In each hop, Message Queuing subtracts the time elapsed from MaxTimeToReachQueue when it dispatches the message to the next computer, where a new timer is set. Once a message arrives at the queue, MaxTimeToReachQueue can be used to find out how much time remains in the time-to-reach-queue timer. A value of 0 indicates the specified time interval has elapsed.
Message Queuing uses two message timers: time-to-reach-queue and time-to-be-received. If the time-to-be-received timer is set to a value less than the time-to-reach-queue timer, the time-to-be-received timer takes precedence over the time-to-reach-queue timer.
No matter what value MaxTimeToReachQueue is set to (even if it is set to 0), Message Queuing always gives each message one chance to reach its destination. All the computers on the way and the queue are in a ready state. If the queue is local, the message always reaches the queue.
When several messages are sent in a transaction, Message Queuing automatically uses the time-to-reach-queue timer of the first message. For more information, see Message Queuing Transactions.
When Message Queuing creates an acknowledgment message, it always sets the message's time-to-reach-queue time interval to LONG_LIVED.
When a message is sent from an independent client computer, the time-to-reach-queue timer starts ticking as soon as the send operation of the sending application succeeds, even if the client computer is offline.
Equivalent API Function Property
With API function calls, the equivalent property is PROPID_M_TIME_TO_REACH_QUEUE.
Windows NT/2000/XP: Included in Windows NT 4.0 SP3 and later.
Windows 95/98/Me: Included in Windows 95 and later.
Header: Declared in Mqoai.h.
Library: Use Mqoa.lib.