Versions Compared

Key

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

This page walks you through the steps to follow when configuring WSO2 ESB's JMS transport with WSO2 Message Broker (WSO2 MB). Click the required tab for step by step instructions based on the version of WSO2 MB that you are going to use. 

Note
titleNote

When you configure WSO2 ESB’s JMS transport with WSO2 MB, the recommended version of WSO2 MB to be used is WSO2 MB 3.0.0. We do not recommend the use of WSO2 MB 2.2.0 or lower.

Localtabgroup
Localtab
titleConfigure with WSO2 Message Broker 3.0.0

Follow the steps below to configure the ESB's JMS transport with WSO2 MB 3.0.0

Setting up WSO2 MB

  1. Download and install WSO2 MB. For instructions on how to download and install WSO2 MB, see Getting Started with WSO2 MB
    The unzipped WSO2 MB distribution folder will be referred to as <MB_HOME> throughout the documentation.

    Info
    titleNote

    It is not possible to start multiple WSO2 products with their default configurations simultaneously in the same environment. Since all WSO2 products use the same port in their default configuration, there will be port conflicts. Therefore, to avoid port conflicts, apply a port offset in the <MB_HOME>/repository/conf/carbon.xml file by changing the offset value to 1. For example,

    Code Block
    languagehtml/xml
    <Ports>
       <!-- Ports offset. This entry will set the value of the ports defined below to
     the define value + Offset.
     e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445
     -->
       <Offset>1</Offset>
  2. Open a command prompt (or a shell in Linux) and go to the <MB_HOME>\bin directory.
  3. Start the Message Broker by executing sh wso2server.sh (on Linux/OS X) or wso2server.bat (on Windows).

Setting up WSO2 ESB

  1. If you have not already done so, see Getting Started with WSO2 ESB for details on installing and running WSO2 ESB.
  2. To enable the JMS transport of WSO2 ESB to communicate with the Message Broker, edit the <ESB_HOME>/repository/conf/axis2/axis2.xml file, find the commented <transport receiver> block and uncomment it as shown below.

    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">repository/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">repository/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">repository/conf/jndi.properties</parameter>
               <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
               <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
           </parameter>
       </transportReceiver>

    Also, 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. Copy the following JAR files from the <MB_HOME>/clent-lib folder to <ESB_HOME>/repository/components/lib folder.
    • andes-client-3.0.1.jar
    • geronimo-jms_1.1_spec-1.1.0.wso2v1.jar
    • org.wso2.securevault-1.0.0-wso2v2.jar
  4. Open <ESB_HOME>/repository/conf/jndi.properties file and make a reference to the running Message Broker as specified below:
    • Use carbon as the virtual host.

    • Define a queue named JMSMS.
    • Comment out the topic, since it is not required in this scenario. However, in order to avoid getting the javax.naming.NameNotFoundException:TopicConnectionFactory exception during server startup, make a reference to the Message Broker from the TopicConnectionFactory as well. 

      Anchor
      jndi
      jndi
      For example:

      Code Block
      # register some connection factories
      # connectionfactory.[jndiname] = [ConnectionURL]
      connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
      connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
      # register some queues in JNDI using the form
      # queue.[jndiName] = [physicalName]
      queue.JMSMS=JMSMS
      queue.StockQuotesQueue = StockQuotesQueue
  5. Ensure that WSO2 Message Broker is running, and then open a command prompt (or a shell in Linux) and go to the <ESB_HOME>\bin directory.
  6. Start the ESB server by executing sh wso2server.sh (on Linux/OS X) or wso2server.bat (on Windows).

Now you have instances of both WSO2 Message Broker and WSO2 ESB configured and running.

 

Localtab
titleConfigure with WSO2 Message Broker 2.2.0 or lower

Follow the steps below to configure the ESB's JMS transport with WSO2 MB 2.2.0 or lower

Setting up WSO2 MB

  1. Download and install WSO2 MB. For instructions on how to download and install WSO2 MB, see Getting Started with WSO2 MB
    The unzipped WSO2 MB distribution folder will be referred to as <MB_HOME> throughout the documentation.

    Info
    titleNote

    It is not possible to start multiple WSO2 products with their default configurations simultaneously in the same environment. Since all WSO2 products use the same port in their default configuration, there will be port conflicts. Therefore, to avoid port conflicts, apply a port offset in the <MB_HOME>/repository/conf/carbon.xml file by changing the offset value to 1. For example,

    Code Block
    languagehtml/xml
    <Ports>
       <!-- Ports offset. This entry will set the value of the ports defined below to
     the define value + Offset.
     e.g. Offset=2 and HTTPS port=9443 will set the effective HTTPS port to 9445
     -->
       <Offset>1</Offset>
  2. WSO2 MB uses a Cassandra server that is bundled with it by default for storage. However, in a production setup, using an external Cassandra server that is capable of handling large volumes of queues is recommended. When an external Cassandra server is used, point the Message Broker to it by editing the value of the <connectionString>  in <MB_HOME>/repository/conf/advanced/andes-virtualhosts.xml accordingly. For information on setting up WSO2 MB with an external server, see the Clustering and Deployment Guide.
     

    Code Block
    languagehtml/xml
    <store>
       <class>org.wso2.andes.server.store.CassandraMessageStore</class>   
       <username>admin</username>  
       <password>admin</password>
       <cluster>ClusterOne</cluster>   
       <idGenerator>org.wso2.andes.server.cluster.coordination.TimeStampBasedMessageIdGenerator</idGenerator>   
       <connectionString>localhost:9161</connectionString>
    </store>
    
  3. The default message batch size for browser subscriptions of Message Broker is 200. If needed, you can increase it to a larger value by setting the following property in the <MB_HOME>/repository/conf/advanced/qpid-config.xml file.

    Code Block
    languagehtml/xml
    <messageBatchSizeForBrowserSubscriptions>100000</messageBatchSizeForBrowserSubscriptions>
  4. Open a command prompt (or a shell in Linux) and go to the <MB_HOME>\bin directory.
  5. Start the Message Broker by executing sh wso2server.sh (on Linux/OS X) or wso2server.bat (on Windows).

Setting up WSO2 ESB

  1. If you have not already done so, see Getting Started for details on installing and running WSO2 ESB.
  2. To enable the JMS transport of WSO2 ESB to communicate with the Message Broker, edit the <ESB_HOME>/repository/conf/axis2/axis2.xml file, find the commented <transport receiver> block and uncomment it as shown below.

    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">repository/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">repository/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">repository/conf/jndi.properties</parameter>
               <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">QueueConnectionFactory</parameter>
               <parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
           </parameter>
       </transportReceiver>

    Also, 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 details on the JMS configuration parameters used in the code segments above, see JMS Connection Factory Parameters.

  3. Copy the following JAR files from the <MB_HOME>/clent-lib folder to <ESB_HOME>/repository/components/lib folder. They are client libraries required from Message Broker to ESB.
    • andes-client-0.13.wso2v10

    • geronimo-jms_1.1_spec-1.1.0.wso2v1

  4. Open <ESB_HOME>/repository/conf/jndi.properties file and make a reference to the running Message Broker as specified below:
    • Use carbon as the virtual host.

    • Define a queue named JMSMS.
    • Comment out the topic, since it is not required in this scenario. However, in order to avoid getting the javax.naming.NameNotFoundException:TopicConnectionFactory exception during server startup, make a reference to the Message Broker from the TopicConnectionFactory as well. 

      Anchor
      jndi
      jndi
      For example:

      Code Block
      # register some connection factories
      # connectionfactory.[jndiname] = [ConnectionURL]
      connectionfactory.QueueConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'
      connectionfactory.TopicConnectionFactory = amqp://admin:admin@clientID/carbon?brokerlist='tcp://localhost:5673'


  5. Ensure that WSO2 Message Broker is running, and then open a command prompt (or a shell in Linux) and go to the <ESB_HOME>\bin directory.
  6. Start the ESB server by executing sh wso2server.sh (on Linux/OS X) or wso2server.bat (on Windows).

Now you have instances of both WSO2 Message Broker and WSO2 ESB configured and running.