Versions Compared

Key

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

...

  • Install WSO2 Enterprise Integrator. For information on how you can install, see the Installing the Product.
  • Deploy the sample back-end service.

    In this example, the SimpleStockQuoteService serves as the back-end service and receives the message from the SMSForwardProxy proxy service via the JMS transport. The response sent by the SimpleStockQuoteService is published in the SMSReceiveNotificationStore queue that is set as the value of the transport.jms.ReplyDestination parameter of the SMSSenderProxy proxy service. This allows the SMSSenderProxy to pick the response and deliver it to the client. Follow the steps below to build and deploy the SimpleStockQuoteService:

    1. Open a command prompt (or a shell in Linux) and go to the <EI_HOME>/samples/axis2Server/src/SimpleStockQuoteService directory.
    2. Run ant

  • Follow the steps below to enable the JMS transport of the ESB profile to communicate with the Message Broker profile:

    1. Edit the <EI_HOME>/conf/axis2/axis2.xml file, find the commented <transport receiver> block and uncomment it as follows:

      Code Block
      languagehtml/xml
       <!--Uncomment this and configure as appropriate for JMS transport support with WSO2 MB 2.x.x -->
         <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
             <parameter name="myTopicConnectionFactory" locked="false">
                <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
                 <parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
                 <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">TopicConnectionFactory</parameter>
                 <parameter name="transport.jms.ConnectionFactoryType" locked="false">topic</parameter>
             </parameter>
       
             <parameter name="myQueueConnectionFactory" locked="false">
                 <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
                 <parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
                 <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
                <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
             </parameter>
       
             <parameter name="default" locked="false">
                 <parameter name="java.naming.factory.initial" locked="false">org.wso2.andes.jndi.PropertiesFileInitialContextFactory</parameter>
                 <parameter name="java.naming.provider.url" locked="false">conf/jndi.properties</parameter>
                 <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
                 <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
             </parameter>
         </transportReceiver>
    2. Uncomment the following <transport sender> block for JMS in the same file:

      Code Block
      languagehtml/xml
      <!-- uncomment this and configure to use connection pools for sending messages-->
      <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>
      Info

      For more information on the JMS configuration parameters used in the code segments above, see JMS Connection Factory Parameters.

    3. Open the <EI_HOME>/conf/jndi.properties file and update the connection factories and queues as follows:

      Code Block
      # register some connection factories
      # connectionfactory.[jndiname] = [ConnectionURL]
      connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5675'
      
      # register some queues in JNDI using the form
      # queue.[jndiName] = [physicalName]
      queue.SMSStore=SMSStore
      queue.SMSReceiveNotificationStore=SMSReceiveNotificationStore
    4. Copy the following JARs from the <EI_HOME>/wso2/broker/client-lib folder to the <EI_HOME>/lib folder.
      • andes-client-3.2.19.jar
      • geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
      • org.wso2.securevault-1.0.0-wso2v2.jar

  • Start the Message Broker Profile. For information on how to start the ESB Message Broker Profile, see see Starting the ESB profileMessage Broker profile.
  • Start the ESB Profile. For information on how to start the ESB Profile, see see Starting the Message Broker ESB profile.

Configuring the JMS publisher

...

Code Block
languagexml
titleSample proxy service
<proxy xmlns="http://ws.apache.org/ns/synapse"
       name="SMSSenderProxy"
       transports="https,http"
       statistics="disable"
       trace="disable"
       startOnLoad="true">
   <target>
      <inSequence>
         <property name="transport.jms.ContentTypeProperty"
                   value="Content-Type"
                   scope="axis2"/>
      </inSequence>
      <outSequence>
         <property name="TRANSPORT_HEADERS" scope="axis2" action="remove"/>
         <send/>
      </outSequence>
      <endpoint>
         <address uri="jms:/SMSStore?transport.jms.ConnectionFactoryJNDIName=QueueConnectionFactory&amp;java.naming.factory.initial=org.wso2.andes.jndi.PropertiesFileInitialContextFactory&amp;java.naming.provider.url=conf/jndi.properties&amp;transport.jms.DestinationType=queue&amp;transport.jms.ReplyDestination=SMSReceiveNotificationStore"/>
      </endpoint>
   </target>
   <description/>
</proxy>

This proxy service accepts messages sent via the HTTP transport, and stores the messages in the SMSStore queue queue in the Message Broker Profile of WSO2 EI.

The endpoint of this proxy service uses the following properties to map the proxy service with the Message Broker Profile.:

PropertyValue for this use caseDescription

address uri

jms:/SMSStore

The destination in which the request received by the proxy service is stored.

java.naming.factory.initial

org.wso2.andes.jndi.PropertiesFileInitialContextFactory

The initial context factory to use.
The value specified here should be the same as that specified in <EI_HOME>/conf/axis2/axis2.xml for the JMS transport receiver.

java.naming.provider.url

conf/jndi.properties

The location of the JNDI service provider.

transport.jms.DestinationType

queueThe destination type of the JMS message that will be generated by the proxy service.
transport.jms.ReplyDestination

SMSReceiveNotificationStore

The destination in which the response generated by the back-end service is stored.

...