PROPID_M_TIME_TO_REACH_QUEUE

The PROPID_M_TIME_TO_REACH_QUEUE property specifies a time limit (in seconds) for the message to reach the queue.

Type Indicator
VT_UI4
PROPVARIANT Field
ulVal
Property Values
Integer value (the default is LONG_LIVED).

Remarks

PROPID_M_TIME_TO_REACH_QUEUE sets the message's time-to-reach-queue timer. For a discussion of message timers, see Message Timers. If the time-to-reach-queue timer expires before the message reaches its destination, MSMQ discards the message, sending it to the dead letter queue if the message's PROPID_M_JOURNAL property is set to MQMSG_DEADLETTER.

MSMQ can also send a return negative acknowledgment message back to the sending application if the message does not arrive and the message's PROPID_M_ACKNOWLEDGE property is set accordingly.

To set the time-to-reach-queue timer, pass PROPID_M_TIME_TO_REACH_QUEUE to MQSendMessage.

The default value LONG_LIVED is an enterprise-wide setting that can be adjusted by the MSMQ administrator. Typically, LONG_LIVED is set to 90 days. Although this timer can be set to INFINITE, MSMQ automatically uses the LONG_LIVED value in its place.

To find out how much time remains in the time-to-reach-queue timer, pass PROPID_M_TIME_TO_REACH_QUEUE to MQReceiveMessage and look at the returned value. A value of 0 indicates the timer has expired.

If the time-to-be-received and time-to-reach-queue timers are both specified, the time-to-be-received timer takes precedence over the time-to-reach-queue timer.

No matter what value PROPID_M_TIME_TO_REACH_QUEUE is set to (even if set to 0), MSMQ always gives each message one chance to reach its destination if the queue is waiting for the message. If the queue is local, the message always reaches the queue.

MSMQ uses the time-to-reach-queue timer of the first message when several messages are sent in a transaction. For information on transactions, see MSMQ Transactions.

When MSMQ creates an acknowledgment message, it always sets the message's time-to-reach-queue timer 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 succeeds, even if the client computer is offline.

QuickInfo

  Windows NT: Requires version 4.0 SP3 or later.
  Windows: Requires Windows 95 or later.
  Windows CE: Unsupported.
  Header: Declared in mq.h.
  Import Library: Use mqrt.lib.
  Unicode: Defined only as Unicode.

See Also

MQReceiveMessage, MQSendMessage, PROPID_M_ACKNOWLEDGE, PROPID_M_JOURNAL, PROPID_M_TIME_TO_BE_RECEIVED