How to integrate JBoss 7.x with Tibco EMS using 'Generic JMS RA'?

How to integrate JBoss 7.x with Tibco EMS using 'Generic JMS RA'?

book

Article ID: KB0090590

calendar_today

Updated On:

Products Versions
TIBCO Enterprise Message Service -
Not Applicable -

Description

Resolution:
Description:
======================
How to integrate JBoss 7 with Tibco EMS using 'Generic JMS RA'?

Resolution:
=======================
A generic JMS resource adapter can be used to integrate JBOSS 7.x with EMS. However, if you download a Generic JMS resource adapter and deploy it to JBoss 7.x, it will not work. You can use the attached genericra.rar being modified for this integration.

Use the following steps for the integration:

1). Configure EMS client libraries in JBoss 7.x
   a). Create the following folders structure [Jboss7]\modules\com\tibco\tibjms\main, then copy tibjms.jar and tibcrypt.jar to [Jboss7]\modules\com\tibco\tibjms\main.
   b). Create module.xml with the following content:

<module xmlns="urn:jboss:module:1.1" name="com.tibco.tibjms">
    <resources>
          <resource-root path="tibjms.jar"/>
          <resource-root path="tibcrypt.jar"/>
    </resources>
     <dependencies>
          <module name="javax.api"/>
          <module name="javax.jms.api"/>
    </dependencies>
</module>

   c). Open [Jboss7]\modules\org\jboss\as\ee\main\module.xml and add a dependency to com.tibco.tibjms:

<dependencies>
     <!-- Don't delete what was written here, just add com.tibco.tibjms at the bottom -->
     <module name="com.tibco.tibjms"/>
</dependencies>

2). Configure Resource Adapter in JBoss 7.x

   a) Startup JBoss 7.x with following commands:

standalone.bat -c standalone-full.xml
or
standalone.bat

    b). In the administrator console -> Runtime, click Deployment -> "Management Deployments" and go to Deployment page. Deploy the attached genericra.rar into JBoss 7.x.

    c). In the administrator console -> profile, click Connector -> "Resource Adapters" and go to the Resource Adapter configurations page. Click "add" to create a new Resrouce Adapter with archive name: genericra.rar.

    d). Add the following properties for genericra.rar

ProviderIntegrationMode=jndi
UserName=[EMS user name]
Password=[EMS password]
JndiProperties=java.naming.factory.url.pkgs=com.tibco.tibjms.naming,java.naming.factory.initial=com.tibco.tibjms.naming.TibjmsInitialContextFactory,java.naming.provider.url=[EMS JNDI server URL]:[port number]
SupportsXA=true
LogLevel=finest


      e). Open standalone-full.xml or standalone.xml (if you start with standalone.bat) ([Jboss7]\standalone\configuration\standalone-full.xml) and add the following lines in  <subsystem xmlns="urn:jboss:domain:ejb3:1.2">

<mdb>
     <resource-adapter-ref resource-adapter-name="genericra.rar"/>
     <bean-instance-pool-ref pool-name="mdb-strict-max-pool"/>
</mdb>

3). Configure connection factory and queue from the EMS side:

Create the connection factory and queue that you want to use. For example, create the following connection factory and queue for the attached MDB sample using EMS admin tool:

create factory MyConnectionFactory xaqueue url=tcp://tibcohost:7222
create queue MySampleQueue

4). Complie and deploy the sample MDB: Helloworld-mdb.zip. For example, when testing with JBoss application server 7.1.1 final version, JBoss 7.1.1 is installed under C:\jboss-as-7.1.1.Final directory.

   a). Download the attached Helloworld-mdb.zip file and unzip to a directory. For example: C:\jboss-as-7.1.1.Final\helloworld-mdb directory.

    b). Download Maven 3.0.2 from following URL: http://maven.apache.org/download.html.

    c). Copy tibjms.jar and tibcrypt.jar to C:\jboss-as-7.1.1.Final\helloworld-mdb\src\main\webapp\WEB-INF\lib directory.

    d). Install artifactID to maven.

For example, run following command:

[maven installation bin directory]\mvn install:install-file -Dfile=C:\jboss-as-7.1.1.Final\modules\org\jboss\ejb3\main\jboss-ejb3-ext-api-2.0.0.jar -DgroupId="org.jboss.ejb3" -DartifactId="jboss-ejb3-ext-api" -Dversion="2.0.0" -Dpackaging=jar

     e). Compile and Deploy Helloworld-mdb to JBoss 7.x.

For example, go to helloworld-mdb directory: C:\jboss-as-7.1.1.Final\helloworld-mdb, run following command:

[maven installation bin directory]\mvn package jboss-as:deploy

5). Test sample MDB.

You can go to this URL: http://localhost:8080/jboss-as-helloworld-mdb/HelloWorldMDBServletClient

It will send several messages to test the sample MDB. You should see JBOSS console log showing the messages being received. You can also test with sending some messages to EMS queue: MySampleQueue by any program or tool.

Issue/Introduction

How to integrate JBoss 7.x with Tibco EMS using 'Generic JMS RA'?

Attachments

How to integrate JBoss 7.x with Tibco EMS using 'Generic JMS RA'? get_app
How to integrate JBoss 7.x with Tibco EMS using 'Generic JMS RA'? get_app