This site contains the documentation that is relevant to older WSO2 product versions and offerings.
For the latest WSO2 documentation, visit https://wso2.com/documentation/.
Using the Dead Letter Channel
The Dead Letter Channel (DLC) is a sub-set of a queue, specifically designed to persist messages that are typically marked for deletion, providing you with a choice on whether to delete, retrieve or reroute the messages from the DLC. A DLC queue is created when the first subscription is made for a specific domain (superuser or tenant). By default, the message broker retries a defined number of times when a subscriber does not acknowledge a message. Once the retry count has been breached, the message is removed from the queue and placed in the DLC. The default number of retries is set to 10, however, this value is configurable. See the section on configuring the message retry count for more information.
External publishers/subscribers are not permitted to publish/subscribe to the DLC queue.
Browsing through the DLC Queue
All messages that have breached the retry count will be dumped into the DLC queue. The content of the queue can be viewed by following the steps below.
- Log in to the Management Console.
- Click Dead Letter Channel - > Browse in the Main tab.
- The DLC browser is displayed in the right side of the pane, as shown below. The message count specifies the number of messages in the DLC queue.Â
- Click Browse to view details of each message stored in the DLC. The Destination column shows the name of the original queue. Â
- You can choose to delete, restore or reroute one or more messages:
- Delete:Â Permanently delete the message from MB.
- Restore:Â Re-insert the message to the queue from which the message originated.
- ReRoute: Allows you to select a destination of choice instead of restoring the message to the original queue. When you click ReRoute, a pop-up menu appears, as shown below:
Select the queue name to which the message should be re-routed and click OK. The message is then moved to the relevant queue.
Handling multitenancy
To ensure that messages can be distinguished per tenant, a separate DLC is created for every new tenant in the system. The signature of the DLC queue is similar to the example shown below.
{tenant_name}/DeadLetterChannel
This ensures that only the messages exchanged through queues in a specific tenant domain are inserted to the DLC queue.
Configuring the message retry count
The message retry count can be configured as follows:
- Open the
broker.xml
file located in the <MB_HOME>/repository/confÂ
folder. Locate the
maximumRedeliveryAttempts
 attribute and change the value accordingly. See the following example.<maximumRedeliveryAttempts>15</maximumRedeliveryAttempts>