Edit | Attach | New | Raw | Delete | History | Print | Tools

Configuring Oracle Advanced Queueing

Oracle's Advanced Queueing functionality also includes JMS/XA drivers that can be used with Atomikos.

NOTE: this configuration procedure was last tested with Oracle version 10.2.0.2.0

Disclaimer: this is how we used OracleAQ in conjunction with TransactionsEssentials. For another approach, see http://thinkfunctional.blogspot.com/2012/05/atomikos-and-oracle-aq-pooling-problem.html (third party blog post).

Preliminaries

We assume that the Oracle database (in which AQ stores the messages) is already enabled for XA. See http://www.atomikos.com/Documentation/ConfiguringOracleForXA on how to do that.

Create the Queues (optional)

If no queues exist then they need to be created first. The easiest way to get started is to create each queue of type AQ$_JMS_MESSAGE (see the DBMS_AQJMS PL/SQL package). Ask you DBA to do this for you...

Set the JMS user's privileges

JMS is just another way of accessing OracleAQ (or Oracle Streams, as it is also called). You need to enable the necessary priviliges for users to use JMS in Oracle. The following privileges are required:

  • EXECUTE rights on DBMS_AQJMS
  • EXECUTE rights on DBMS_AQIN
  • ENQUEUE rights on each queue to send to
  • DEQUEUE rights on each queue to receiver from

Note: some of the above database objects may need to be defined first - please contact your DBA for further assistance.

Create the Atomikos ConnectionFactory

Create a connection factory as follows:

//create and configure an oracle-specific XA connection factory
oracle.jdbc.xa.client.OracleXADataSource xads = new oracle.jdbc.xa.client.OracleXADataSource();
xads.setUser ( "..." );
xads.setPassword("...");
xads.setURL("...");
XAQueueConnectionFactory xacf = AQjmsFactory.getXAQueueConnectionFactory (
            xads
   ); 

AtomikosConnectionFactoryBean qcf = new AtomikosConnectionFactoryBean();
qcf.setUniqueResourceName ( "..." );
qcf.setXaConnectionFactory ( xacf );

IMPORTANT

Make sure to configure the Oracle XAConnectionFactory as outlined above, or you will get problems like these: Known Problems

You should now be able to send/receive JMS messages to and from OracleAQ.

More Information

Also see the following Oracle docs for more information:

spacer
Copyright © 2014 Atomikos BVBA. Transaction Management for Extreme Transaction Processing and SOA Environments serving ISV, Commercial, OEM and Open Source Markets
Site map RSS ATOM