title | summary | reviewed | component | redirects | related | ||
---|---|---|---|---|---|---|---|
MSMQ Dead Letter Queues |
Controlling MSMQ Dead Letter Queue behavior |
2024-10-09 |
MsmqTransport |
|
|
Dead Letter Queues is a feature of MSMQ that tracks messages that are undeliverable, deleted, expired etc. NServiceBus endpoints will by default enable DLQ for all outgoing messages except messages that have a Time To Be Received(TTBR) set. This avoids expired messages ending up either in the TDLQ or DLQ (if non-transactional queues are used) wasting disk space on the machine when they time out.
DLQ can be disabled for the entire endpoint using the MSMQ connection string.
Note
If DLQ is enabled messages will remain in the senders outgoing queue until processed and count towards disk space quota on the senders machine.
partial: config
MSMQ moves messages that cannot be delivered to their destination to the DLQ. This may be due to misconfiguration of routing or queues being purged. See Dead-Letter Queues for a comprehensive list of conditions under which messages may be moved to the DLQ.
It is very important to monitor the DLQ in order to detect potential routing configuration errors or other situations that may lead to messages being moved to the dead-letter queue.
Note
While there is usually a central error queue managed by NServiceBus, each machine has a separate dead-letter queue. This means that the DLQ on each machine has to be monitored individually.
The following addresses can be used to read messages from DLQ on a given machine:
DIRECT=OS:{MACHINE-NAME}\SYSTEM$;DEADLETTER
DIRECT=OS:{MACHINE-NAME}\SYSTEM$;DEADXACT
The MSMQ Queue performance object contains counters that can be used to monitor the number of messages in various queues. Value of the Messages in Queue counter of the Computer Queues instance tracks the number of messages in the DLQ on a given machine.