Monday, September 23, 2013

Configure WSO2 Business Process Server (BPS) with JBOSSMQ

The following instructions describe how to set up the JMS transport with JBossMQ, the default JMS provider in JBoss Application Server 4.2

To configure the JMS transport with JBossMQ:

You can download JBossMQ from here.

Copy the following client libraries to the <BPS_HOME>/repository/components/lib directory.
  • <JBOSS_HOME>/lib/jboss­system.jar
  • <JBOSS_HOME>/client/jbossall­client.jar
Enable the JMS transport listener by adding the following listener configuration to the <BPS_HOME>/repository/conf/axis2/axis2.xml file:


 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
<!--­­ Configuration for JBoss 4.2.2 GA MQ ­­-->
<transportReceiver name="jms" class="org.apache.axis2.transport.jms.JMSListener">
  <parameter name="MyQueueConnectionFactory" locked="false">
    <parameter name="java.naming.factory.initial" locked="false">org.jnp.interfaces.NamingContextFactory</parameter>
    <parameter name="java.naming.factory.url.pkgs" locked="false">org.jnp.interfaces:org.jboss.naming</parameter>
    <parameter name="java.naming.provider.url" locked="false">jnp://localhost:1099</parameter>
    <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">/ConnectionFactory</parameter>
    <parameter name="transport.jms.Destination" locked="true">queue/susaQueue</parameter>
  </parameter>
  <parameter name="default" locked="false">
    <parameter name="java.naming.factory.initial" locked="false">org.jnp.interfaces.NamingContextFactory</parameter>
    <parameter name="java.naming.factory.url.pkgs" locked="false">org.jnp.interfaces:org.jboss.naming</parameter>
    <parameter name="java.naming.provider.url" locked="false">jnp://localhost:1099</parameter>
    <parameter name="transport.jms.ConnectionFactoryJNDIName" locked="false">/ConnectionFactory</parameter>
    <parameter name="transport.jms.Destination" locked="true">queue/susaQueue</parameter>
  </parameter>
</transportReceiver>

Enable the JMS transport sender by uncommenting the following line in the <BPS_HOME>/repository/conf/axis2/axis2.xml file:


1
<transportSender name="jms" class="org.apache.axis2.transport.jms.JMSSender"/>

After that you have to create the queue in JBOSS. To do that create a file called myQueue-service.xml in <JBOSS_HOME>/server/default/deploy and insert following lines to it.


1
2
3
4
5
6
<server>
 <mbean code="org.jboss.mq.server.jmx.Queue"
    name="jboss.mq.destination:service=Queue,name=susaQueue">
   <depends optional-attribute-name="DestinationManager">jboss.mq:service=DestinationManager</depends>
</mbean>
</server>

Now you can start the JBOSS server. You can ensure that the queue which you are created inside JBOSS by reading the log file.

Start the BPS and ensure that the logs prints messages indicating that the JMS listener and sender are started and that the JMS transport is initialized.

No comments:

Post a Comment