PROPID_M_TIME_TO_REACH_QUEUE (Compact 2013)

3/26/2014

This 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 time-to-reach-queue timer of the message.

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, the queue for storing messages that could not be delivered, if the PROPID_M_JOURNAL property of the message 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 PROPID_M_ACKNOWLEDGE property of the message is set accordingly.

To set the time-to-reach-queue timer, specify PROPID_M_TIME_TO_REACH_QUEUE in the MQMSGPROPS structure and call MQSendMessage.

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 Message Queuing administrator. By default, this setting equals four 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 new Windows .NET domain.
  • Clients running MSMQ 3.0 that join an existing domain.

The default enterprise-wide setting for messages sent from a computer in a migrated enterprise and computers running MSMQ 1.0 or MSMQ 2.0 in Windows 2000 and Windows NT 4.0 enterprises is 90 days.

To find out how much time remains in the time-to-reach-queue timer, specify PROPID_M_TIME_TO_REACH_QUEUE in the MQMSGPROPS structure. Then call MQReceiveMessage and examine 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 specified, the time-to-be-received timer takes precedence over the time-to-reach-queue timer.

Regardless of which value that PROPID_M_TIME_TO_REACH_QUEUE is set to (even if set to 0), MSMQ 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.

When MSMQ creates an acknowledgment message, it sets the time-to-reach-queue timer of the message 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.

Requirements

Header

mq.h

See Also

Reference

MSMQ Properties
MQReceiveMessage
MQSendMessage
PROPID_M_ACKNOWLEDGE
PROPID_M_JOURNAL
PROPID_M_TIME_TO_BE_RECEIVED
MQMSGPROPS