This documentation is for WSO2 Enterprise Integrator version 6.1.1 . View documentation for the latest release in the 6.x.x family and the latest release in the 7.x.x family.

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

Note that WSO2 EI is shipped with the following changes to what is mentioned in this documentation :

  • <PRODUCT_HOME>/ repository/samples/ directory that includes all Integration profile samples is changed to <EI_HOME>/ samples/service-bus/.
  • <PRODUCT_HOME>/ repository/samples/resources/ directory that includes all artifacts related to the Integration profile samples is changed to <EI_HOME>/ samples/service-bus/resources/.

Objective: Demonstrate sending request response scenario with JMS transport

<definitions xmlns="http://ws.apache.org/ns/synapse">
   <proxy name="StockQuoteProxy" transports="http">
       <target>
           <endpoint>
                   <address uri="jms:/SimpleStockQuoteService?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&
                 java.naming.factory.initial=org.apache.activemq.jndi.ActiveMQInitialContextFactory&java.naming.provider.url=tcp://localhost:61616&transport.jms.DestinationType=queue"/>
           </endpoint>
           <inSequence>
               <property action="set" name="transport.jms.ContentTypeProperty" value="Content-Type" scope="axis2"/>
           </inSequence>
           <outSequence>
               <property action="remove" name="TRANSPORT_HEADERS" scope="axis2"/>
               <send/>
           </outSequence>
       <target>
       <publishWSDL uri="file:repository/conf/sample/resources/proxy/sample_proxy_1.wsdl"/>
   </proxy>
</definitions>

Prerequisites:

  • You need to set up ESB and axis2 server to use the JMS transport. See Sample 251 for more details.

This sample is similar to Sample 251. Only difference is we are expecting a response from the server. JMS transport uses transport.jms.ContentTypeProperty to determine the content type of the response message. If this property is not set JMS transport treats the incoming message as plain text.

In the out path we remove the message context property TRANSPORT_HEADERS. If these property is not removed JMS headers will be passed to the client.

Start ESB using sample 264.

./wso2esb-samples.sh -sn 264

Start Axis2 server with SimpleStockService deployed

Invoke the stockquote client using the following command.

ant stockquote -Daddurl=http://localhost:8280/services/StockQuoteProxy -Dsymbol=MSFT

The sample Axis2 server console will print a message indicating that it has received the request:

Generating quote for : MSFT

In the client side it should print a message indicating it has received the price.

Standard :: Stock price = $154.31851804993238
  • No labels