Nirvana JMS - Application Server Integration (Jboss)

JMS provides extensions that allows JMS providers to be integrated into Application Servers. This section describes the steps involved in integrating Nirvana JMS with boss. All references to jboss assume jboss version 3.2.x or 4.0.x are being used.

This guide will provide the following information:

Configuration Terms

Firstly, for the following sections, we will be referencing certain directories for the install. These are described below:

<jboss_home> - the jboss installation directory
<jboss_bin> - the jboss bin directory located under <jboss_home>/bin
<jboss_default> - default server, under <jboss_home>/server/default
<jboss_default_lib> - default server lib directory, under <jboss_default>/lib
<jboss_default_deploy> - default server deploy directory, under <jboss_default>/deploy
<jboss_default_conf> - default server configuration directory, usually <jboss_default>/conf

Message Queue Configuration

Jboss provides it's own JMS Message Queue service that we need to replace with Nirvana's own JMS Sevice. This section will describe the steps needed to integrate Nirvana's Message service into boss.

To do this we need to change the references in the jboss xml configuration files so that the Nirvana Message Queue service is used:

In the <jboss_default_conf>/standardjboss.xml file and replace the tags that say DefaultJMSProvider with NirvanaJMSProvider.

Server Session Pool Configuration

Jboss provides it's own server session pool objects that allow multiple JMS sessions to be pooled within the Message Queue Service. Nirvana also provides it's own session pool objects. This section describes the steps necessary to integrate Nirvana's Server Session Pool into jboss.

To do this we need to change the references in the jboss xml configuration files so that Nirvana's Server Session Pools are used by the Message Queue Service:

In the <jboss_default_conf>/standardjboss.xml file and replace the tags that say StdJMSPool with NirvanaJMSPool.

Jboss Configuration

This section describes the steps necessary to ensure the jboss server is ready to begin using Nirvana as the Message Queue Service provider. Please complete the following steps:

  1. Remove the <jboss_default_deploy>/JMS directory completely
  2. Put the Nirvana-service.xml file into the <jboss_default_deploy> directory (found in the src/xml/jboss directory of your install)
  3. Put the Nirvana nJMS.jar, nClient.jar and nJ2EE.jar files into the <jboss_default_lib> directory from your /lib directory of the install
  4. Modify the run script for jboss to include the following –D parameter when the jboss server is started:
    -Dnirvana.provider.url=<your.Nirvana.rname (e.g.) nsp://localhost:9000 which is the default RNAME

Nirvana Realm Server Configuration

In order to configure the Nirvana Realm Server, please ensure you have either read the Nirvana Enterprise Manager JNDI integration section or are familiar with the the jmsadmin sample programs. These tools enable you to create the Nirvana JNDI objects necessary for the jboss server to successfully use Nirvana as the JMS message queue provider. In this example, we will use the jmsadmin example program, however should you choose to, you can also use the Nirvana Enterprise Manager by following the steps found in the guide.

Please follow the steps below:

  1. Start the Nirvana 3.0 server
  2. Open a Nirvana Client environment prompt
  3. Type : jmsadmin bind topicFactory TopicConnectionFactory (followed by return)
  4. Type : jmsadmin bind queueFactory QueueConnectionFactory (followed by return)
  5. Type : jmsadmin bind queue queue/DLQ (followed by return)

This will set up the queue and topic factories used by the Nirvana JMS message service, as well as setting up the jboss DLQ used for internal message processing.

Once these steps have been completed, you can then start the jboss server which will now be using Nirvana JMS as the message queue provider

Running Message Driven Beans

Message driven beans can be deployed within application servers to provide a run-frame for JMS services. Once you have created your message driven beans and they are deployed into the jboss server, you must ensure that all topics and queues used by the MDBs have been created using the jmsadmin tool, so that they can be referenced within the Nirvana JNDI context used by the Nirvana messaging service.