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

Preliminaries

We assume that the Oracle database (in which AQ stores the messages) is already enabled for XA. See http://www.atomikos.com/Publications/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:

QueueConnectionFactoryBean qcf = new QueueConnectionFactoryBean();
//create and configure an oracle-specific XA connection factory
XAQueueConnectionFactory xacf = ...
qcf.setResourceName ( "..." );
qcf.setXaQueueConnectionFactory ( xacf );
qcf.setXidFactory ( "Oracle" );

Note the "Oracle" XidFactory: this is because Oracle needs special transaction ids.

IMPORTANT

Make sure to configure the Oracle XAConnectionFactory as outlined in the workaround of this known issue: http://www.atomikos-support.com/forums/viewtopic.php?t=334

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:

Go
r4 - 22 Jul 2008 - 07:17:41 - GuyPardon
This site is powered by the TWiki collaboration platformCopyright © contributing authors and Atomikos. All material on this collaboration platform is the shared property of the contributing authors and Atomikos.
Syndicate this site RSSATOM