There are different ways to exchange JMS messages between WebLogic and JBoss Application Server 7. In this blogpost I will explain how you can retrieve JMS messages from JBoss ( with the help of a WebLogic Foreign Server ) and how to push messages to JBoss AS ( with the help of a WebLogic JMS Bridge). This even works with AQ.
For JBoss AS 7 I will use the JMS ( HornetQ ) / JBoss configuration which I already explained in this blogpost. On the WebLogic side I will use WebLogic 11gR1 PS5 or version 10.3.6.
Before we start we need to add the jboss / hornetq jars to the lib folder of your domain. Use jboss-client.jar from the bin/client jboss folder and we need to download the lates HornetQ libraries ( hornetq-2.2.14.Final) . Use the hornetq-jms-client.jar from the HornetQ lib folder.
The best way to retrieve JMS messages from JBoss AS 7 is using a WebLogic Foreign Server. In the current version of JBoss 7.1.1 it is not possible to setup bridging in the console or in one of the instances xml's.
Create a Foreign Server in a JMS module and use default targetting or target this to a WebLogic server
JNDI Initial Contect Factory is org.jboss.naming.remote.client.InitialContextFactory
JNDI Connection URL is remote://yourJbossServer:4447
Provide the remote password
In the JNDI properties add the remote username java.naming.security.principal=xxxxx
Provide the Remote JNDI name of the Queue.
Provide the remote JNDI name of the JBoss Connection Factory -> jms/RemoteConnectionFactory
Now you deploy a MDB or a OSB process which listens on the local JNDI CF and Queue.
Second part is setting up a JMS bridge between WebLogic and JBoss. This way local messages in a local JMS or AQ Queue can be pushed to JBoss AS.
First we need to deploy two resource adapters jms-notran-adp and jms-xa-adp these rar files are located at the wlserver_10.3\server\lib. Deploy them as application and target them to the right weblogic servers.
Add a JMS Bridge Destination ( JBoss AS), this configuration is almost the same as the JBoss Foreign Server configuration.
Only choose eis/jms/WLSConnectionFactoryJNDIXA as Adapter JNDI Name.
The JMS Bridge Source ( WebLogic side )
Add a Bridge where we select the Destination and Source. Important, use Atmost-once for Quality of Service. Exactly once won't work.
Enable the started checkbox.
Add some messages to the WebLogic Queue and see if it delivered to JBoss.
Last part is to use Oracle Database AQ as source for this JMS bridge. For all the information, how to setup AQ on WebLogic see this excellent Oracle Documentation.
Create a Foreign Server, target this to a WebLogic server and use oracle.jms.AQjmsInitialContextFactory as JNDI Initial Context Factory also add a JNDI property with the JDBC datasource as value.
Add the AQ Queue name with its local WebLogic JNDI name.
Also define the Connection Factory.
And here the matching JMS bridge source which will work on the AQ Foreign server.