All docs This doc
||
Skip to end of metadata
Go to start of metadata

Message Channels facilitate communication between applications. A sender adds a message to a particular channel, which a receiver can read. Message Channels allow the sender and receiver to synchronize.

For more information, go to Message Channel

The following sections explain how you can implement a sample scenario of this EIP using the ESB profile of WSO2 EI. 

Sample scenario 

The sample scenario depicts how a stock inventory is made from a sender application to the receiver application through a Message Channel. The Message Channel retrieves the message content from the sender, and it allows the receiver to read the content through the Message Channel. The diagram below depicts how to simulate the sample scenario using the ESB profile.

 The Synapse configurations of the artifacts

When you unzip the ZIP file you download below in Step 6 when simulating the sample scenario, you can find the below configurations in the <UNZIPPED_FILE>/src/main/synapse-config directory. For more information about these artifacts, go to WSO2 EI Documentation.

<?xml version="1.0" encoding="UTF-8"?>
<proxy name="message-channel-proxy" startOnLoad="true" transports="http https"
    xmlns="http://ws.apache.org/ns/synapse">
    <target>
        <inSequence>
            <sequence key="message-channel-sequence"/>
        </inSequence>
        <outSequence>
            <log level="custom">
                <property name="sending response to" value="client"/>
            </log>
            <respond/>
        </outSequence>
        <faultSequence/>
    </target>
</proxy>
<?xml version="1.0" encoding="UTF-8"?>
<sequence name="message-channel-sequence" trace="disable"
    xmlns="http://ws.apache.org/ns/synapse">
    <log level="custom">
        <property name="sending request to" value="axis2 server"/>
    </log>
    <send>
        <endpoint>
            <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
        </endpoint>
    </send>
</sequence>

Simulating the sample scenario 

Follow the below instructions to simulate this sample scenario.

message-channels-axis2

Analysing the output

When you execute the request, the ESB profile first receives the message and then routes it to the back-end service (StockQuoteService). The following output will be printed on the Axis2 Server Console: 


The generated stock quote will then be sent to the client application (Stock Quote Client). The following output will be printed on the client application Console:

  • No labels