Configuring JMS Servers for High Availability

Overview

In the below scripts, we first connect to the WebLogic Admin Server using connect command. Then we start editing the domain using edit and startEdit commands.

Finally, we save and activate the changes using save and activate commands.

Note: These examples assume that you are already connected to the WebLogic server using WLST. You will need to modify the server name, port number, username, password, and resource names according to your environment.

Create a JMS Server Cluster

connect('username', 'password', 't3://localhost:7001')
edit()
startEdit()

jmsServerCluster = create('myJMSServerCluster', 'JMSServerCluster')
jmsServerCluster.addTarget(getMBean('/Servers/myServer'))

save()
activate()

Configure a JMS Server to Use a Cluster

connect('username', 'password', 't3://localhost:7001')
edit()
startEdit()

jmsServer = create('myJMSServer', 'JMSServer')
jmsServer.addTarget(getMBean('/JMSServerClusters/myJMSServerCluster'))

save()
activate()

Configure a JMS Module to Use a JMS Server Cluster

connect('username', 'password', 't3://localhost:7001')
edit()
startEdit()

jmsModule = create('myJMSModule', 'JMSSystemResource')
jmsModule.addTarget(getMBean('/JMSServerClusters/myJMSServerCluster'))
jmsSubDeployment = jmsModule.createSubDeployment('myJmsSubDeployment')
jmsSubDeployment.addTarget(getMBean('/Servers/myServer'))

save()
activate()

Create a JMS Bridge

connect('username', 'password', 't3://localhost:7001')
edit()
startEdit()

jmsBridge = create('myJMSBridge', 'JMSBridge')
jmsBridge.setSourceDestination(getMBean('/JMSResource/myJMSModule/myQueue'))
jmsBridge.setTargetDestination(getMBean('/JMSResource/myOtherJMSModule/myQueue'))
jmsBridge.addTarget(getMBean('/Servers/myServer'))

save()
activate()

These are just a few examples of the WLST scripting commands that can be used to configure high availability for WebLogic JMS server. With these scripts, you can easily create JMS server clusters, configure JMS servers to use clusters, configure JMS modules to use JMS server clusters, and create JMS bridges.

About the author

Mohit Chaudhary

Hey there, I am IT enthusiast who is passionate about Middleware, DevOps, Cloud and much more.

View all posts

Leave a Reply

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