Skip Headers
Oracle® Containers for J2EE Enterprise JavaBeans Developer's Guide
10g (10.1.3.5.0)

Part Number E13981-01
Go to Documentation Home
Home
Go to Book List
Book List
Go to Table of Contents
Contents
Go to Index
Index
Go to Feedback page
Contact Us

Go to previous page
Previous
Go to next page
Next
View PDF

Configuring an OEMS JMS Message Service Provider

To configure the OEMS JMS message service provider (see "OEMS JMS: In-Memory or File-Based Provider"), you must do the following:

  1. Choose appropriate JNDI names for your destination and connection factory (see "OEMS JMS Destination and Connection Factory Names").

  2. Configure the <OC4J_HOME>/j2ee/home/config/jms.xml file (see "Configuring jms.xml") to specify the type of destination and connection factory.

    You can specify factories that are either not XA-compliant, when two-phase commit (2PC) transactions are not needed, or XA-compliant, when 2PC transactions are needed. For more information on 2PC, see "How do You Participate in a Global or Two-Phase Commit (2PC) Transaction?".

  3. Optionally, map the actual JNDI names to logical names (see "Configuring an Environment Reference to a JMS Destination or Connection Resource Manager Connection Factory (JMS 1.0)").

  4. Configure your message-driven beans to access your OEMS JMS message service provider.

    For more information, see the following:

    Note:

    Oracle recommends that you access a message service provider using a J2CA resource adapter such as the Oracle JMS Connector. For more information, see "Restrictions When Accessing a Message Service Provider Without a J2CA Resource Adapter".

OEMS JMS Destination and Connection Factory Names

The actual JNDI names for the JMS destination and connection factory are the ones you specify in the jms.xml file (see "Configuring jms.xml").

Table 23-1 lists the form of these names.

Table 23-1 OEMS JMS Destination and Connection Factory Names

Type Form

Queue

jms/Queue/<QName>

Queue Connection Factory

jms/Queue/<QCFName>

Topic

jms/Topic/<TName>

Topic Connection Factory

jms/Topic/<TCFName>


Configuring jms.xml

You configure OEMS JMS options in the <OC4J_HOME>/j2ee/home/config/jms.xml file. In this release, the jms.xml is defined by the XML schema document (XSD) located at http://www.oracle.com/technology/oracleas/schema/jms-server-10_1.xsd.

Some of the options you can configure in the jms.xml file include the following:

  • JMS Destination objects used by the MDB.

  • Topic or queue in the jms.xml file to which the client sends all messages that are destined for the MDB.

  • The name, location, and connection factory for either Destination type must be specified.

    You can specify factories that are either not XA-compliant, when two-phase commit (2PC) transactions are not needed, or XA-compliant, when 2PC transactions are needed. For more information on 2PC, see "How do You Participate in a Global or Two-Phase Commit (2PC) Transaction?".

  • If your MDB accesses a database for inquiries and so on, then you can configure the data source used. For information on data source configuration, see the Data Source chapter in the Oracle Containers for J2EE Services Guide.

  • Path to a file in which OEMS JMS events and errors are written.

Example 23-1 shows the jms.xml file configuration for an EJB 2.1 MDB that specifies a queue (named jms/Queue/rpTestQueue) that is used by the message-driven bean rpTestMdb (see Example 17-1). The queue connection factory is defined as jms/Queue/myQCF. In addition, a topic is defined named jms/Topic/rpTestTopic, with a connection factory of jms/Topic/myTCF.

Example 23-1 jms.xml For an EJB 2.1 MDB using OEMS JMS Factories

<jms>
    <jms-server port="9128">
        <queue location="jms/Queue/rpTestQueue"></queue>
        <queue-connection-factory location="jms/Queue/myQCF"></queue-connection-factory>
        <topic location="jms/Topic/rpTestTopic"></topic>
        <topic-connection-factory location="jms/Topic/myTCF"></topic-connection-factory>
        <log>
             <!-- path to the log-file where JMS-events and errors are written -->
             <file path="../log/jms.log" />
        </log>
    </jms-server>
</jms>

Example 23-2 shows the jms.xml file configuration for the same MDB using XA factories for two-phase commit (2PC) support.

Example 23-2 jms.xml For an EJB 2.1 MDB using OEMS JMS XA Factories

<jms>
    <jms-server port="9128">
        <queue location="jms/Queue/rpTestQueue"></queue>
        <xa-queue-connection-factory location="jms/Queue/myXAQCF"></queue-connection-factory>
        <topic location="jms/Topic/rpTestTopic"></topic>
        <xa-topic-connection-factory location="jms/Topic/myXATCF"></topic-connection-factory>
        <log>
             <!-- path to the log-file where JMS-events and errors are written -->
             <file path="../log/jms.log" />
        </log>
    </jms-server>
</jms>