Show TOC Start of Content Area

Procedure documentation Integrating an External JMS Provider  Locate the document in its SAP Library structure

Use

JMS Connector Service enables you to use an external JMS provider with the J2EE Engine. This procedure describes which steps you need to follow to integrate the JMS provider with the application server.

Procedure

       1.      Deploy the JMS provider’s client library to the J2EE Engine.

To use a JMS provider, you must register the client libraries that it provides as a J2EE Engine library. You can choose one of the following approaches:

                            a.      Build and deploy a library SDA using the SAP NetWeaver Developer Studio. For more information about building and deploying libraries, see Working with J2EE Libraries.

Caution

You must set a reference to the JMS library in the provider.xml of the library SDA. For more information, see Adding JARs and References.

Recommendation

To prevent collisions with the JTA and JMS libraries used by the J2EE Engine, we recommend to remove the javax.jms.* and javax.transaction.* packages from the library.

After you have deployed the library to the J2EE Engine, you must define it as a JMS library. For more information, see Defining and Un-defining a JMS Library.

                            b.      Deploy the library archive using JMS Connector Service runtime in Visual Administrator. For more information, see Deploying and Removing a JMS Library.

Recommendation

We recommend to remove the javax.jms.* and javax.transaction.* packages from the library. In this scenario, you are not required to add any references.

       2.      Make sure the required native libraries of the JMS provider are added to the system path on each machine where a Java instance is running.

       3.      Register a JMS connection factory.

A JMS connection factory may be obtained either by a lookup operation in the JNDI system, or using a javax.naming.spi.ObjectFactory instance. A JMS provider may enable both JNDI- and ObjectFactory-based access to administered objects.

According to the type of the JMS provider, you must specify different parameters when registering a JMS connection factory. To define which option you must use, check the provider’s documentation.

This graphic is explained in the accompanying text

Typically, JMS vendors provide samples to illustrate the use of the relevant JMS system. You can define the type of the provider using the samples. For example, if a new InitialContext is created and used for a lookup operation to obtain the connection factory, the JMS provider is JNDI-based.

For more information, see:

       Registering a JMS ConnectionFactory using JNDI-Based Provider

       Registering a JMS ConnectionFactory using Non-JNDI Provider

       4.      Register a JMS destination.

For more information, see Registering a JMS Destination.

Result

You can use the registered JMS connection factory to establish a connection to the JMS provider. To do that, you must set a resource reference to the connection factory in the SAP-specific deployment descriptor of the application component. For more information, see:

      Declaring Resource References (for enterprise beans)

      Configuring Resource References (for Web components)

Having set a resource reference, you can look up the connection factory in your application component using the string java:comp/env/<resource_reference_name>.

End of Content Area