Versions Compared

Key

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

Objective: Demonstrate one way message bridging from JMS to HTTP and replying with a HTTP 202 Accepted responseusing inbound JMS endpoint.

Prerequisites
  • Start the Axis2 server and deploy the SimpleStockQuoteService if not already done.
  • Start the Synapse configuration numbered 253901wso2esb-samples.sh -sn 253901
Code Block
languagehtml/xml
linenumberstrue
<definitions xmlns="http://ws.apache.org/ns/synapse">
    <proxy name="JMStoHTTPStockQuoteProxy" transports="jms">
        <target>
            <inSequence>
                <property action="set" name="OUT_ONLY" value="true"/>
            </inSequence>
            <endpoint>
                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            </endpoint>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
    </proxy>
    <proxy name="OneWayProxy" transports="http">
        <target>
            <inSequence>
                <log level="full"/>
            </inSequence>
            <endpoint>
                <address uri="http://localhost:9000/services/SimpleStockQuoteService"/>
            </endpoint>
            <outSequence>
                <send/>
            </outSequence>
        </target>
        <publishWSDL uri="file:repository/samples/resources/proxy/sample_proxy_1.wsdl"/>
    </proxy>
</definitions>
 

This example invokes the one-way placeOrder operation on the SimpleStockQuoteService using the Axis2 ServiceClient.fireAndForget() API at the client. To test this, use ant -Dmode=placeorder... and you will notice the one way JMS message flowing through ESB into the sample Axis2 server instance over HTTP, and Axis2 acknowledging it with a HTTP 202 Accepted response.

...