Sunday, September 15, 2013

Working With Weblogic JMS Bridge

Weblogic messaging bride is a type of forwarding mechanism for JMS messages which can be used to transfer messages between two different domains of weblogic server. Basically the bridge has a Source Destination and a Target Destination which used along with JMS adapter helps to send the messages from one place to other. In this blog post have captured some of the configuration steps for JMS bridge to work:

1. Create a persistent store 
In Admin console; Click Lock and Edit and Under Persistent Stores ; Select New ; Create  FileStore
Name the store and target it to a specific server and finally activate the changes.









2. Create a JMS Server
In Admin console ; Click Lock and Edit and Under JMS Servers ; Select New
Set a name and select the corresponding FileStore and set the target to a specific server and after finishing, finally activate the changes

3. Create JMS Module
In Admin console ; Click Lock and Edit and Under JMS Servers  ; Select New
Click Next and Target it to the Servers and again click next. In the below page select the Check Box and click finish.







Click on the JMSModule and navigate to the Subdeployments page and click on New. Select a name and also target it to the JMS servers created earlier.

4. Create Connection Factory













Provide Name and JNDI name leaving rest fields as default and in next page click on Advanced targeting and select the subdeployment created earlier












5. Create Queue
Next create a Distributed JMS queue providing name and JNDI and under Advanced targeting, select the subdeployment created. Once finished activate the changes.











6. Create JMS Bridge Destinations
First create the source bridge destination.
In Admin console ; Click Lock and Edit and Under JMS Bridge Destinations ; Select New 
Provide the below details:
Connection URL: t3://source hostname:port/
Connection Factory JNDI Name: 
Destination JNDI Name: 

Click on OK and then click on source bridge destination name and ensure that the Weblogic credentials are correctly set there. This would be source server/domain credentials from where messages will be read.

Similar fashion create a target bridge destination and provide corresponding details.

NOTE: If weblogic is installed on a clustered server, the Connection URL format will be:
t3://node1 hostname:port,node2 hostname:port

Once done activate changes.

7. Create JMS Bridge
In Admin console ;Click Lock & Edit and Under Bridges ; Select New.
Provide name, select the corresponding source and target JMS destinations and finally click on Finish.

If all configuration is correct, we should see the below status for the JMS bridge under Monitoring tab.









NOTE :
For the XA Adapter to work the following file has to be deployed to Weblogic with name
jms-xa-adp  from /MW_Home/wlserver_10. 3/server/lib/jms-xa-adp.rar
Else the JMS bridge may give an error  "WARN: Failed to find the source/target adapter "

Apart from the JMS bridge configuration, need to create the corresponding JNDI name under deployments which will be used at runtime and this should be have the correct Connection factory(created in step4) configured in it.

The same JNDI name configured above will be used at design time while configuring the JMS adapter in Jdeveloper. Also the target destination name (JMS queue created in step5) will be configured in JMS adapter.