Share via


Message Timers

Applies To: Windows Server 2008

Message timers

Message Queuing provides two timers to help you maintain better control of your messages: a time-to-reach-queue and a time-to-be-received timer.

The time-to-reach-queue (TTRQ) timer determines how long a message has to reach the queue manager of the target queue. Typically, this timer is set to a value less than the time-to-be-received setting.

The time-to-be-received timer determines how long a message remains in the system, starting from the time the message is sent to the time it is removed from the target queue.

The time-to-reach-queue and time-to-be-received timers can be set programmatically using the Message.TimeToReachQueue and Message.TimeToBeReceived properties respectively. For more information about setting these properties see the MSDN library at https://go.microsoft.com/fwlink/?LinkId=65914.

If you do not specify a TTRQ value, the following default settings apply:

  • 4 days for messages sent from the following types of computers:

    • Computers running Message Queuing 4.0 or later in workgroup mode.

    • Clients running Message Queuing 4.0 or later, or Message Queuing 3.0 that belong to a completely new Windows Server 2008 domain.

    • Clients running Message Queuing 4.0 or later, or Message Queuing 3.0 that join an existing domain provided weakened security was not enabled for that forest.

  • 90 days for messages sent from the following types of computers:

    • Any computer in a migrated enterprise and computers running MSMQ 1.0 or MSMQ 2.0 in Windows 2000 and Windows NT 4.0.

For information about how to set the lifetime of messages on your network, see Set the Default Lifetime for Messages.

The default setting for the time-to-be-received timer is that no limit is set.

When both timers are used and the time-to-be-received timer is set to a smaller value than the TTRQ timer, the time-to-be-received timer takes precedence. For example, if the time-to-be-received timer is set to 3 minutes and the TTRQ timer is set to 10 minutes, Message Queuing will discard the message after 3 minutes. A message is not allowed to remain in the system longer than the time specified by the time-to-be-received timer.

When a timer expires, Message Queuing discards the message. However, Message Queuing can also send a copy of the discarded message to the applicable dead-letter queue or it can send a negative acknowledgment message to an administration queue.

Discarded messages can be sent to dead-letter queues if the journal property of the message specifies a dead-letter queue. Copies of nontransactional messages are sent to the dead-letter queue on the computer where the timer expired. Copies of transactional messages are sent to the transactional dead-letter queue on the source machine.

Acknowledgment messages are returned if a timer expires and the acknowledgment property of the message specifies full or negative acknowledgments. Message Queuing sends the appropriate negative acknowledgment message to the administration queue specified by the message.