In Oracle Application Server 10.1.3 ( OC4J) you can use OJMS to expose AQ with JMS (text) Message as type and use it as a normal JMS Queue or Topic in Soa Suite or a Message driven Bean. See my previous blog for more details. With the release of Weblogic 10.3.1 ( WLS FMW11g ) we can do the same with a Foreign JMS Server. Before 10.3.1 we had to make a startup class to achieve this.
First create a Queue and Queue table with SYS.AQ$_JMS_MESSAGE as payload type in your Oracle Database and make sure you enable enqueue /dequeue on this Queue.
In Weblogic we have to create a JMS server and a JMS module.
Create a new JDBC datasource with a schema user which can enqueue or dequeue the just created queue. Use the XA JDBC driver, with this driver you can use global and local transactions. with NON-XA driver you can only use local transactions, this can be problem when you want to use this Queue in Soa Suite.
Select your JMS module in the WLS Console and create a new Foreign Server.Open the Foreign Server so we can configure this AQ server.
Change JNDI Initial Context Factory to oracle.jms.AQjmsInitialContextFactory and we have to provide the jndi datasource name in the JNDI Properties field, For Example datasource=jdbc/scottDS
Create a JMS connection factoryAs local JNDI name you can choose what you like. For Remote you have to choose one of these values. QueueConnectionFactory, TopicConnectionFactory, ConnectionFactory, XAQueueConnectionFactory, XATopicConnectionFactory or XAConnectionFactory
Now we can create a new Destination.As Local JNDI name you can choose any name but as Remote JNDI it needs to start with Queues or Topics after that add a / with the database queue or topic name.
We are ready to use this AQ Queue in a Soa Suite Composite application. Where we will use the JMS adapter.Select Oracle Advanced Queuing as OEMS
and select the Foreign Server Destination.
For more Weblogic AQ JMS details see the official documentation.
EJB Session Bean Security in Weblogic
11 hours ago

10 comments:
Hi Edwin
I need to access from OSB to this AQJMS... How I must put the URI??
jms://host:port:/XAQueueConnectionFactory/Queues.Queue_Read
??
Thank You.
JP
Great article !
Thanks a lot.
I'm trying to configure remote destination (pointing to AQ) but I can't find oracle.jms.AQjmsInitialContextFactory
class.
Could you please suggest where it is located?
Thanks.
Hi,
Strange are you using wls 10.3.1, I didn't do anything special for that.
thanks
Hi,
I'm using WL 10.3.1 and I'm still getting the error 'Can not get destination information. The destination JNDI name is jms/xxxxx, the provider URL is null'
Is there any way to activate some debug logging ?
Hi,
Did you make a queue and CF in the foreign server. and the remote jndi name must match you queue or topic.
and in the jms adapter resource , connect to this local CF and local Queue.
thanks Edwin
I've made some progress :
- logging can be turned on by adding environment startup property '-Doracle.jms.traceLevel=6'
- but now the AQjmsContext is used to also lookup the 'weblogic.jms.MessageDrivenBeanConnectionFactory'. Any ideas? The message driven bean just uses the local jndi name of the jms queue.
The error :
[ACTIVE] ExecuteThread: '1' for queue: 'weblogic.kernel.Default (self-tuning)' [Thu Sep 17 13:36:15 CEST 2009] AQjmsContext.lookup failed for weblogic.jms.MessageDrivenBeanConnectionFactory: Exception
: javax.naming.NamingException: Unrecognized prefix in: weblogic.jms.MessageDrivenBeanConnectionFactory
javax.naming.NamingException: Unrecognized prefix in: weblogic.jms.MessageDrivenBeanConnectionFactory
at oracle.jms.AQjmsContext.lookup(AQjmsContext.java:150)
at javax.naming.InitialContext.lookup(InitialContext.java:392)
at weblogic.ejb.container.internal.JMSConnectionPoller.getConnection(JMSConnectionPoller.java:465)
at weblogic.ejb.container.internal.JMSConnectionPoller.createJMSConnection(JMSConnectionPoller.java:1991)
Ok, Now I know what you mean.
If you only have to difine in a MDB the local jndi of the queue or topic and not the CF then this will not work, I think
because with the remote CF jndi name you control where you use XA and when this is a queue or topic.
Without settings this It won't work.
maybe you can find some info about foreign server and MDB
thanks
Can this help
once you configured foreign jms server, you could treat it as local weblogic jms server. So you don't need to specify provider-url if you deploy it on the local server. For remote access, it looks like:
* @weblogic.message-driven destination-jndi-name="jms/QUEUE"
* connection-factory-jndi-name="jms/testqcf"
* provider-url="t3://wlsservername:port/"
* initial-context-factory="weblogic.jndi.WLInitialContextFactory"
I came to the same conclusion: setting the connection-factory-jndi-name is sufficient btw.
This method works with Oracle custom XMLType too (not just JMS standard Text message). If you are listening, simply cast the Message to import oracle.jms.AdtMessage; If you are posting cast QueSession to AQjmsSession
Post a Comment