MSMQMessage.MaxTimeToReachQueue (Compact 2013)

3/26/2014

This property specifies a time limit, in seconds, for the message to reach the queue.

Syntax

HRESULT get_ MaxTimeToReachQueue( 
  long* plMaxTimeToReachQueue 
);
HRESULT put_MaxTimeToReachQueue( 
  long lMaxTimeToReachQueue
);

Parameters

  • plMaxTimeToReachQueueor lMaxTimeToReachQueue
    Time limit, in seconds, for the message to reach the queue.

    The default is LONG_LIVED.

Return Value

The following table describes the common return values.

Value

Description

S_OK

Success

E_INVALIDARG

One or more arguments are invalid

E_NOTIMPL

The function contains no implementation

E_OUTOFMEMORY

Out of memory

Remarks

MaxTimeToReachQueue sets the message's time-to-reach-queue timer. If the time-to-reach-queue timer expires 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 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 lMaxTimeToReachQueue interval. This enterprise-wide setting can be adjusted by the Message Queuing 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 Windows .NET 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 a computer in a migrated enterprise and computers running MSMQ 1.0 or MSMQ 2 in Windows 2000 and Windows NT 4.0 enterprises is 90 days.

After 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 timer has expired.

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 set to 0), Message Queuing 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.

Message Queuing uses the time-to-reach-queue timer of the first message when several messages are sent in a transaction.

When Message Queuing creates an acknowledgment message, it 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.

Equivalent Function Property

When using function calls, the time-to-reach-queue timer of the message can be set and retrieved using the PROPID_M_TIME_TO_REACH_QUEUE message property.

Requirements

Header

mqoai.h

Library

mqoa.lib

See Also

Reference

MSMQMessage
MSMQMessage.Ack
MSMQMessage.Journal
PROPID_M_TIME_TO_REACH_QUEUE