Oracle AQ

Is anyone using Oracle AQ with 6.5 or 7.1 in production env?, also is it possible to configure standard JMS?, oracle documentation drives toward using OJMS, and in theory we could use JMS/OJMS as provider, then use JMSTriggers to retrieve messages

Thanks,
Oswaldo

I have configured IS 7.x to use AQ as a JMS provider. In order to accomplish this, I had to configure OC4J to expose the database queues as JMS destinations. I needed to use OC4J 10.1.3 or greater to support the JMS 1.1 features that IS will leverage. Here is a list of things I did to configure this - no warranties, your mileage may vary :slight_smile:

  1. Configure OC4J:
    Once OC4J is installed and started, login to the admin interface:
    http://yourserver:8888/em/

Start by creating a JDBC connection that will connect OC4J to the Oracle DB (under Administration->JDBC Resources). Create a connection pool and then a data source that uses this pool. Make sure the user you indicate on this connection has appropriate AQ grants in Oracle.

Next, create a resource adapter and a provider (under Administration->Database Persistence). These are created in one step: click the Deploy button to create the new adapter and provider. Make sure you chose the datasource you just configured. Note the name that you give the Resource Provider (not the adapter) because it will be used to form the JNDI location when you specify connection factories later. After you create the adapter/provider, you’ll need to restart OC4J. Even though the admin application provides a link at the top of your page to restart the “default” application after the resource adapter is created, this doesn’t always work…I always use a full shutdown/restart of OC4J.

Once you restart, you’ll need to configure some connection factories on the resource adapter you created. Note that you do this under Administration->Database Persistence and NOT under Administration->JMS Connection Factories. Click on the resource adapter you create above (it should be called “OJMS RA”). Click on the Connection Factories tab and click the create button. You can create multiple types of connection factories here, but I just created a javax.jms.ConnectionFactory interface. In the JNDI Location field, enter a name for your CF (“DarrynsConnectionFactory”). Also, there’s a property section on this page with a jndiLocation property. Change that to include your name (“ConnectionFactories/DarrynsCF”). You’ll need to note this property name because you will use it when you create the connection object on the IS side later. At that time you’ll have to specify the fully qualified JNDI name that will include the name of the resource adapter that you created above:
java:comp/resource/darrynsRP/ConnectionFactories/DarrynsCF

Now you can check to make sure that OC4J can communicate with the DB and expose the queue tables (under Administration->JMS Destinations). The resource adapter you configured inspects the DB and will expose all of the queue tables that it finds. If you add new queue tables in the DB later, they will automatically be exposed through OC4J without any additional configuration in OC4J. When you find a queue table you want to work with, you’ll need to note the JNDI location (you’ll use this location when you create JMS Triggers in Developer later) for example:
java:comp/resource/darrynsRP/Queues/DEMOQUEUE

  1. At this point, you should test the OC4J JMS provider with a standalone java client. Lots of examples of this on the web.

  2. Add Oracle JAR files to IS (in $IS_HOME\lib\jars)

  • aqapi.jar from $OC4J_HOME\rdbms\jlib
  • bcel.jar from $OC4J_HOME\j2ee\home\lib
  • classes12.jar from $ORACLE_DB_HOME\jdbc\lib (oracle jdbc drivers)
  • jms.jar from $OC4J_HOME\j2ee\home\lib
  • nls_charset12.jar from $ORACLE_DB_HOME\jdbc\lib
  • oc4jclient.jar from $OC4J_HOME\j2ee\home

*** The oracle code will try to find the com\evermind\util\JCAProperties class. This class is part of another jar that had a class conflict when I included it in the IS classpath. I had to remove it from its jar and put into its own jar to resolve (attached).

  1. Restart IS

  2. Setup JNDI Provider Alias (under Settings->Messaging->JNDI Settings)
    JNDI Alias Name: AQJMS11_JNDI
    Description: JNDI Provider for 1.1 compliant JMS services
    Initial Context Factory: oracle.j2ee.rmi.RMIInitialContextFactory
    Provider URL: ormi://localhost/default

Click the green arrow to test the JNDI connection. You should see a list of objects returned.

  1. Setup a JMS Connection Alias (under Settings->Messaging->JMS Settings)

  2. Enable the connection

Once these steps are completed, you can use the webMethods Integration Server JMS Client Developer’s Guide to implement JMS logic to interact with Oracle AQ. Hope this helps!
jca_class.jar (951 Bytes)

Great Thanks,

This really helps,

Thanks a lots,

Regards,
Oswaldo

Thanks for the information.

what ever lookup name,i see during JNDI Lookup. Used same name to create JMS setting,but not able to create JMS adapter