Due to a known issue do not use JDK1.8.0_151 with WSO2 products. Use JDK 1.8.0_144 until JDK 1.8.0_162-ea is released.
This documentation is for WSO2 Message Broker version 3.2.0. For the latest documentation, see the documentation for WSO2 Enterprise Integrator.
Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 4 Current »

The Dead Letter Channel (DLC) is a sub-set of a queue, which is used for storing messages that have not been delivered to the intended subscriber. The DLC provides you the option of deleting these messages, retrieving them or rerouting them to another queue. In the case of rerouting the message to a different queue, the message will be received by the clients subscribed to this second queue. Therefore, since the subscribers of the second queue are not expecting to receive messages from another queue, it will be necessary for such subscriber clients to identify the destination (subscriber) to which the message was originally sent. 

To achieve this, we are using a custom JMS property that embeds the routing key to the message. We are embedding the routing key to a JMS property of the message from the andes-client side. The embedding is enabled only when the “AndesSetRoutingKey” system property is set to a non-null value (any value other than null) in the publisher client. When the mentioned system property is set, each message will have a JMS property of type string with the “JMS_ANDES_ROUTING_KEY” name, which will contain the routing key.

Configuring the publisher client

The custom JMS property should be enabled for the publisher client as shown below.

System.setProperty("AndesSetRoutingKey", "1");

Configuring the subscriber client

The subscriber client can retrieve the JMS property in the message as shown below.

System.out.println("PROP:" + message.getStringProperty("JMS_ANDES_ROUTING_KEY"));
  • No labels