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
- Configure OC4J:
Once OC4J is installed and started, login to the admin interface:
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:
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:
At this point, you should test the OC4J JMS provider with a standalone java client. Lots of examples of this on the web.
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).
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.
Setup a JMS Connection Alias (under Settings->Messaging->JMS Settings)
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)