datasheet Oracle9 i AS Containers for J2EE (OC4J) - Java Message Service (JMS) - Frequently Asked Questions

Last Updated: October 15, 2002.
Oracle offers two JMS providers;  OJMS (AQ/JMS) and OC4J/JMS.  Which one should I be using?

Can I use other JMS providers with OC4J?

Is multi-session creation supported from one queue connection?

Will non-transacted sessions be supported via the OJMS interface?

Is it possible to utilize the JDBC connection pooling features with OJMS to pool connections from JMS clients?

Can a delay be set on the time a JMS message is delivered?  In other words,  can a certain amount of time be set between when a message is published and when it is available to subscribers?

Is a distributed two-phase commit (2PC) required when combining JMS and Database operations within a Message Driver Bean (MDB)?

How do I configure the OC4J resource provider for OJMS?

Does OC4J support JMS clustering/failover?

Can multiple JMS message types be enqueued to the same OJMS/AQ queue?  In other words, can a JMSText and a JMSByte message reside on the same queue?


Oracle offers two JMS providers;  OJMS (AQ/JMS) and OC4J/JMS.  Which one should I be using?

OJMS is the J2EE 1.3 compliant JMS provider from Oracle.  It has been integrated into Oracle9iAS using a resource provider interface while at the same time leveraging Advanced Queuing in the Oracle9i Database for persistence and recoverability.  If you are planning on using JMS in your development then Oracle strongly recommends using OJMS as the JMS provider. 

In future releases of Oracle9iAS OC4J/JMS will also be J2EE 1.3 compliant and then you will have the choice of which JMS provider best fits your architecture:  one based on Advanced Queuing (OJMS) with all the inherent qualities that come with being part of the Oracle9i Database or a lightweight, in-memory based queuing system (OC4J/JMS). 

The answers in this JMS FAQ are based on using OJMS as the JMS provider unless otherwise noted. 

Can I use other JMS providers with OC4J?

For v9.0.3, OJMS is the only JMS provider that should be used with OC4J. 

Is multi-session creation supported from one queue connection?

Yes, for Oracle9iAS v9.0.3 mult-session creation is supported for both the JDBC thin as well as thick driver.  In Oracle9iAS v9.0.2 only the JDBC thick driver is supports multi-session creation. 

Will non-transacted sessions be supported via the OJMS interface?

Yes, you can create a non-transacted session as follows: 

qsess = qconn.createQueueSession(false, Session.CLIENT_ACKNOWLEDGE);

The client can acknowledge the receipt of a message (in the CLIENT_ACKNOWLEDGE mode) by making a message.acknowledge() call.  Acknowledging the receipt of one message is equivalent to acknowledging the receipt of all the messages before it. 

Is it possible to utilize the JDBC connection pooling features with OJMS to pool connections from JMS clients?

JDBC connection pooling in OJMS is supported only with the OCI JDBC driver.  This is not a function of JMS but rather the JDBC driver itself -- the JDBC thin driver does not support connection pooling. 

Can a delay be set on the time a JMS message is delivered?  In other words,  can a certain amount of time be set between when a message is published and when it is available to subscribers?

Yes, a time delay is supported as an Oracle specific JMS extension to OJMS. You can set the delay on a given OJMS JMS message instance using the " void setDelay(int delay)" method which sets the JMS_OracleDelay message property. 

Is a distributed two-phase commit (2PC) required when combining JMS and Database operations within a Message Driver Bean (MDB)?

No, as long as the business logic inside the MDB uses the same Data Source and username/password, all DS.getConnection calls return the same physical connection.  Therefore, at commit time only one resource is enlisted with JTA so one-phase commit is performed. 

How do I configure the OC4J resource provider for OJMS?

The OC4J resource provider for OJMS is implemented by the class oracle.jms.OjmsContext.  Each OJMS resource provider instance is a <resource-provider ...> XML element (a child element of the orion-application element) in the $J2EE_HOME/config/application.xml file. 

There are three ways of configuring the OJMS resource provider: 

  1. Inline Configuration:  All relevant information for accessing the backend database is specified within the resource-provider element in application.xml.
  2. Data Source Configuration:  the resource provider element in application.xml refers to a data source element configured in data-sources.xml which contains information on accessing the backend database.
  3. LDAP Configuration:  The resource provid element in application.xml contains information to access an OID/LDAP directory which contains information on accessing the backend database.
For more details on using either of these three methods see the Oracle9iAS J2EE Services Guide.

Does OC4J support JMS clustering/failover?

The notion of clustering/failover in JMS has been used by a number of JMS vendors.  The JMS spec/api itself has no mention or support for clustering.  What vendors are often stating by using the term "JMS Clustering" is the ability to provide failover of their persistent queues.

Oracle9iAS does the exact same thing, and more, with OJMS.  Since AQ resides in the Oracle9i Database, you get all the failover and clustering (RAC) capabilities that Oracle9i provides.  Messages are guaranteed to be delivered and they are recoverable in the event of some type of failure.

Can multiple JMS message types be enqueued to the same OJMS/AQ queue?  In other words, can a JMSText and a JMSByte message reside on the same queue?

Yes, when using the AQ$_JMS_MESSAGE data type when creating an AQ queue.  This type of queue can then hold any of the five JMS message types.

 
 


Left Curve
Popular Downloads
Right Curve
Untitled Document