Dead Letter Queues

There are two kinds of dead letter queues, one for non-transaction messages and the other for transaction messages. Both types of queues are created by MSMQ whenever a computer is added to the enterprise.

Dead letter queues hold messages that could not be delivered. For example, a message is placed in the dead letter queue when it is not delivered in time or when a wrong destination queue is specified. When a message is placed in a dead letter queue, MSMQ sets the message's class property to the appropriate negative acknowledgment.

For non-transaction messages, MSMQ sends messages to the dead letter queue of the computer that could not send the message. This could be the source computer, the destination computer, or any MSMQ routing server in between.

Note Only one copy of a message is stored on a computer at one time. If the message reached the next computer successfully, a copy of the message is stored in that computer's journal queue. If the message could not be delivered to the next computer, it is stored in the current computer's dead letter queue.

Transaction messages are treated differently from non-transaction messages. When the sending application does not receive an acknowledgment that the transaction message reached the target queue, or the receiving application does not commit to the transaction, MSMQ automatically sends the transaction message to the transaction dead letter queue on the source computer. Undeliverable transaction messages are never stored on an MSMQ routing server.

However, MSMQ does not automatically send non-transaction messages to a dead letter queue. The sending application must specify that it wants MSMQ to send undeliverable messages to a dead letter queue at the time a message is sent.

Opening a Dead Letter Queue

To read the messages in the dead letter queue (an application cannot send messages to a dead letter queue), the format name used to open the queue should look like one of the following:

MACHINE=MachineGUID;DEADLETTER (for non-transaction messages)
-or-
MACHINE=MachineGUID;DEADXACT (for transaction messages)
 

Note You cannot open these queues using a direct format name.

For an example of reading messages in a dead letter see Reading Messages in a Dead Letter Queue (using API functions).


© 1997 by Microsoft Corporation. All rights reserved.