WebLogic 11g: Setup AQ JMS

Overview

* Uses WebLogic JMS Foreign Server framework.
* Supports RAC via WebLogic Multi Data Sources.

Configure Oracle AQ

* Follow this post to create an AQ queue named TEST_QUEUE owned by a user name aq.

Configure WebLogic Server

Configure a WebLogic Data Source

* Follow this post to create a data source with following properties:
– Name: myAQDS
– JNDI Name: jdbc/myAQDS
– Database Type: Oracle
– Database Driver: Oracle’s Driver (Thin XA) for Service connections; Verions:9.0.1 and later

Create a Dedicated JMS System Module

* Click soa_domain -> Services -> Messaging -> JMS Modules
* Click New button under JMS Modules.
* Enter
– Name: myAQJMSModule
– Descriptor File Name: myAQJMSModule-jms.xml
* Click Next.
* Select target server, e.g. soa_server1.
* Click Next.
* Click Finish.

Create a JMS Foreign Server

* Click soa_domain -> Services -> Messaging -> JMS Modules
* Click the newly created mySQJMSModule.
* Click New button under Summary of Resources.
* On the Choose the type of resource you want to create screen, select Foreign Server.
* Name Foreign Server: myAQForeignServer
* Click Next.
* Click Finish.

Configure JMS Foreign Server to Point to AQ Database via JNDI

* Click the newly created myAQForeignServer.
* Click Configuration -> General tab. Enter:
– JNDI Initial Context Factory: oracle.jms.AQjmsInitialContextFactory
– JNDI Properties: datasource=jdbc/myAQDS

* Click Save.

Configure JMS Foreign Server Connection Factories

* Click soa_domain -> Services -> Messaging -> JMS Modules
* Click myAQJMSModule.
* Click myAQForeignServer.
* Click Configuration -> Connection Factories tab.
* Click New button. Enter:
– Name: myAQCF
– Local JNDI Name: jms/aq/myAQCF
– Remote JNDI Name: XAQueueConnectionFactory

* Click OK.

Other Remote JNDI Names for AQ JMS Connection Factories

* ConnectionFactory
– javax.jms.ConnectionFactory
* QueueConnectionFactory
– javax.jms.QueueConnectionFactory
* TopicConnectionFactory
– javax.jms.TopicConnectionFactory
* XAConnectionFactory
– javax.jms.XQConnectionFactory
* XAQueueConnectionFactory
– javax.jms.XAQueueConnectionFactory
* XATopicConnectionFactory
– javax.jms.XATopicConnectionFactory

Configure AQ JMS Foreign Server Destinations

* Remote JNDI Names are mapped as follows:
– For queue: Queues/queue_name
– For Topics: Topics/topic_name

Configure Queue

* Click soa_domain -> Services -> Messaging -> JMS Modules
* Click myAQJMSModule.
* Click myAQForeignServer.
* Click Configuration -> Destinations tab.
* Click New button. Enter:
– Name: myAQTestQ
– Local JNDI Name: jms/aq/testQ
– Remote JNDI Name: Queues/TEST_QUEUE

* Click OK.

Configure Topic

* Click soa_domain -> Services -> Messaging -> JMS Modules
* Click myAQJMSModule.
* Click myAQForeignServer.
* Click Configuration -> Destinations tab.
* Click New button. Enter:
– Name: myAQTestTopic
– Local JNDI Name: jms/aq/testTopic
– Remote JNDI Name: Topics/TEST_TOPIC
* Click OK.

Restart WebLogic Server Instance

* Don’t forget to restart WebLogic server instance.

Error

java.lang.UnsupportedOperationException: Remote JDBC disabled

* Go to domain bin directory:
cd /opt/oracle/Middleware/home_11gr1/user_projects/domains/soa_domain/bin
* vi setDomainEnv.sh and set WLS_JDBC_REMOTE_ENABLED to true:

#WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=false"
WLS_JDBC_REMOTE_ENABLED="-Dweblogic.jdbc.remoteEnabled=true"
export WLS_JDBC_REMOTE_ENABLED

* Restart server instance.

java.io.NotSerializableException: oracle.jdbc.aq.AQDequeueOptions

Possible Cause

* You are using stand alone JMS client to access AQ JMS destinations. Since the foreign server was configured with JDBC JNDI lookup, JDBC connections thus obtained can not be serialized to standalone clients.

Fix

* Configure foreign server to use direct JDBC connection (instead of JNDI lookup):

* Put following libraries in client classpath:
– AQ JMS, which contains following jars:
~ C:\prog\Oracle\Middleware\wlserver_10.3\server\lib\api.jar,
~ C:\prog\Oracle\Middleware\modules\javax.transaction_1.0.0.0_1-1.jar
– WebLogic 10.3 Remote-Client, which contains following jars:
~C:\prog\Oracle\Middleware\wlserver_10.3\server\lib\weblogic.jar

* See here for more info.
* See this post for sample JMS client.

References

* Interoperating with Oracle AQ JMS
* Professional Oracle WebLogic Server By Robert Patrick, Gregory Nyberg, Philip Aston
* Using AQ ( JMS Text message ) in WLS 10.3.1
* JMS in JDeveloper 11g and WebLogic 10.3

This entry was posted in aq, jms, weblogic. Bookmark the permalink.

4 Responses to WebLogic 11g: Setup AQ JMS

Leave a Reply

Your email address will not be published. Required fields are marked *


*

This site uses Akismet to reduce spam. Learn how your comment data is processed.