Ensuring that all DLQ messages are processed
The dead-letter queue handler keeps a record of all messages on the DLQ that have been seen but not removed. Ensure that the DLQ contains as few messages as possible.
About this task
If you use the DLQ handler as a filter to extract a small subset of the messages from the DLQ, the DLQ handler still keeps a record of those messages on the DLQ that it did not process. Also, the DLQ handler cannot guarantee that new messages arriving on the DLQ are seen, even if the DLQ is defined as first-in-first-out (FIFO). If the queue is not empty, the DLQ is periodically re-scanned to check all messages.
For these reasons, you should ensure that the DLQ contains as few messages as possible. If messages that cannot be discarded or forwarded to other queues (for whatever reason) are allowed to accumulate on the queue, the workload of the DLQ handler increases and the DLQ itself is in danger of filling up.
To enable the DLQ handler to empty the DLQ, take the following measures: