Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

This section explains, through an example scenario, how the Dead Letter Channel EIP can be implemented using WSO2 ESB. The following topics are covered:

Table of Contents

...

The Dead Letter Channel (DLC) EIP outlines how messaging systems can handle messages that cannot be delivered to the recipient. Due to system/network failures or failures at the recipient's end, messages sometimes do not get delivered to the target. In such cases, the messaging system can deliver the message to a DLC. Different mechanisms implemented in the DLC take care of delivering the dead message to the target. One method is periodically retrying to send the message to the recipient over a defined period of time. Persistence of the dead message is another option, which ensures that the dead messages are delivered to the receivers once the system is rebooted, even if the messaging system fails.

For more information, refer to see http://www.eaipatterns.com/DeadLetterChannel.html.

...

WSO2 ESB provides two message store types: in memory and JMS. Users can also define their own custom message store implementations.

  1. Start the ESB server and log into its management console UI (https://localhost:9443/carbon). In the management console, navigate to the Main menu and select the Message Stores sub menu in the Service Bus section.
  2. Create a new message store. In this example, we create test-msg-store.
    Anchor
    create-msg-store
    create-msg-store


  3. Define a message processor called test-msg-processor as follows:

       
  4. Define an endpoint called SimpleStockQuoteService, and set it as the target.endpoint property. The store mediator uses it when storing the message into the message store.


...

  1. Start the sample Axis2 server with SimpleStockQuoteService deployed. For instructions, refer to the section Setting Up the ESB Samples - Starting the Axis2 server in the WSO2 ESB documentation.
  2. Use SoapUI or WSO2 ESB's Try It tool to send the following request to the getSimpleQuote function of StockQuoteProxy service. For information about the Stock Quote client, refer to the section Sample Clients in the WSO2 ESB documentation. 

    the

    Code Block
    <soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:ser="http://services.samples">
       <soapenv:Header/>
       <soapenv:Body>
          <ser:getSimpleQuote>
             <!--Optional:-->
             <ser:symbol>IBM</ser:symbol>
          </ser:getSimpleQuote>
       </soapenv:Body>
    </soapenv:Envelope>
  3. A message similar to the one below appears in the simple Axis server.

  4. Stop the Axis server, and resend the same request. Note that the message sending fails, and the message processor tries to resend the message every few seconds.
  5. Restart the Axis server, and note that the message will be delivered to SimpleStockQuoteService once the server is running.

...