Versions Compared

Key

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

...

Localtabgroup
Localtab
titleConfigure with a standalone HornetQ server

Follow the instructions below to configure the JMS transport with a standalone HornetQ server.

  1. Download HornetQ from the HornetQ Downloads site.
    Anchor
    createQueue
    createQueue
  2. Create a sample queue by editing the <HORNET_HOME>/config/stand-alone/non-clustered/hornetq-jms.xml file as follows:

    Code Block
    languagexml
    <queue name="wso2">
          <entry name="/queue/mySampleQueue"/>
    </queue>
  3. Add the following two connection entries to the same file. These entries are required to enable WSO2 EI to act as a JMS consumer.

    Code Block
    languagexml
    <connection-factory name="QueueConnectionFactory">
          <xa>false</xa>
          <connectors>
             <connector-ref connector-name="netty"/>
          </connectors>
          <entries>
             <entry name="/QueueConnectionFactory"/>
          </entries>
    </connection-factory>
     
     
    <connection-factory name="TopicConnectionFactory">
          <xa>false</xa>
          <connectors>
             <connector-ref connector-name="netty"/>
          </connectors>
          <entries>
             <entry name="/TopicConnectionFactory"/>
          </entries>
    </connection-factory>
  4. If you have not already done so, download WSO2 EI and install as described in the Installation Guide.
  5. Download the  hornet-all-new.jar  file and copy it into the <EI_HOME>/lib/ directory.

    Info
    titleNote

    If you are packing the JARs yourself, make sure you remove the javax.jms package from the assembled JAR to avoid the carbon runtime from picking this implementation of JMS over the bundled-in distribution.

  6. Enable the JMS transport listener and sender.

  7. Start HornetQ with the following command.
    • On Windows: <HORNETQ_HOME>\bin\run.bat --run
    • On Linux/Solaris: sh <HORNETQ_HOME>/bin/run.sh

Now you have configured the JMS transport of the Business Process profile in WSO2 EI with a standalone HornetQ server.

 

Localtab
titleConfigure with HornetQ embedded in a JBoss EAP server

Follow the instructions below to set up and configure the JMS transport with HornetQ embedded in a JBoss EAP server. 

Setting up JBoss EAP

This section describes the steps to install JBoss EAP server and create a message queue within the server. 

  1. Download JBoss EAP Server 7.0.0 from JBoss EAP Downloads and run the JBoss EAP installer as described here.
  2.  Execute one of the following commands in command prompt to create a new application user. 
    • On Windows: <EAP_HOME>\bin\add-user.bat -a -u 'SampleUser' -p 'SamplePwd1!' -g 'guest'
    • On Linux/Mac: <EAP_HOME>/bin/add-user.sh -a -u 'SampleUser' -p 'SamplePwd1!' -g 'guest' 
  3. Create a sample queue by editing the <EAP_HOME>/standalone/configuration/standalone-full.xml file. Add the following content within the <hornetq-server> element:

    Code Block
    languagexml
    <jms-destinations>
          <jms-queue name="sampleQueue">
              <entry name="queue/test"/>
              <entry name="java:jboss/exported/jms/queue/test"/>
          </jms-queue>
    </jms-destinations>
  4. Start the JBoss EAP server by executing one of the following commands in command prompt:
    • On Windows: <EAP_HOME>\bin\standalone.bat -c standalone-full.xml

    • On Linux/Mac: <EAP_HOME>/bin/standalone.sh -c standalone-full.xml

  5. Acess the management console of the JBoss EAP server using the following URL:
    http://127.0.0.1:9990
  6. Log in to the Management Console using admin as both the username and password. In the Profile menu, click Messaging -> Destinations and you will be able to see the queue you added in Step 4 in the Queues/Topics section. 

Now you have configured the JBoss EAP Server. The next section describes how to configure WSO2 EI to listen and fetch messages from the queue that you created above.

Configuring WSO2 EI

  1. If you have not already done so, download and install WSO2 EI.
  2. Enable the JMS listener with the JBoss EAP configuration parameters in the <EI_HOME>/wso2/business-process/conf/axis2/axis2.xml file by adding the following lines of code. 

    Code Block
    languagexml
    <transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
    	<parameter name="QueueConnectionFactory" locked="false">
          		<parameter name="java.naming.factory.initial" locked="false">org.jboss.naming.remote.client.InitialContextFactory</parameter>
         		 <parameter name="java.naming.provider.url" locked="false">remote://localhost:4447</parameter>
          		<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">jms/RemoteConnectionFactory</parameter>
          		<parameter name="transport.jms.UserName" locked="false">SampleUser</parameter>
         		<parameter name="transport.jms.Password" locked="false">SamplePwd1!</parameter>
          		<parameter name="java.naming.security.principal" locked="false">SampleUser</parameter>
          		<parameter name="java.naming.security.credentials" locked="false">SamplePwd1!</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.jboss.naming.remote.client.InitialContextFactory</parameter>
         		 <parameter name="java.naming.provider.url" locked="false">remote://localhost:4447</parameter>
          		<parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">jms/RemoteConnectionFactory</parameter>
          		<parameter name="transport.jms.UserName" locked="false">SampleUser</parameter>
         		<parameter name="transport.jms.Password" locked="false">SamplePwd1!</parameter>
          		<parameter name="java.naming.security.principal" locked="false">SampleUser</parameter>
          		<parameter name="java.naming.security.credentials" locked="false">SamplePwd1!</parameter>
          		<parameter name="transport.jms.ConnectionFactoryType" locked="false">queue</parameter>
    	</parameter>
    </transportReceiver>
    Info

    The username and password created for the guest user in the above section are used in the configuration.  

  3. Copy the jboss-client.jar file from the <EAP_HOME>/bin/client directory to the <EI_HOME>/lib directory.

    Note
    titleNote

    After you copy the jboss-client.jar file from the <EAP_HOME>/bin/client directory to the <EI_HOME>/lib directory, be sure to remove the javax.jms package from the jboss-client.jar file.
     

  4. Enable the JMS sender by uncommenting the following line of code in the <EI_HOME>/wso2/business-process/conf/axis2/axis2.xml file.

    Code Block
    languagexml
    <transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/> 

Now you have configured the JMS transport of the Business Process profile in WSO2 EI with HornetQ embedded in a JBoss EAP server.