12 total views, 5 views today
How to setup JMS as a Migratable service with in a WebLogic Cluster (12C)
This section we briefly described WebLogic migratable jms server to support failover recovery and automatic migration using WebLogic Migratable targets. Some services such as JMS, JTA, and singleton objects are designed to run in only one active server instance in a cluster. These types of services are called Pinned Service. Pinned services cannot be deployed to multiple managed servers in a cluster. What happened if one of the deployed services in the server went down or failed? The solution is migratable targets. A migratable target is a special target which migrates the deployed service from one server to another server in a cluster automatically or manually in case any failure occurs.
Lets talk about messaging models in JMS. WebLogic supports two messaging models, Point to Point(Queue) and Publisher/Subscriber(Topic). Point to Point means one publisher and one subscriber and publisher/subscriber means one publisher and multiple subscribers. This section we are going to create a point to point model, that is QUEUE. Here we are going to create the following things in WebLogic server to support walk through about some of the objects in WebLogic which I briefed below
Migratable Target => It is a mechanism to migrate a service from one server in a cluster to another.
JMS Server => It is a container for resources JMS Queues & Connection factory in a JMS Module. The resource will be targeted to JMS server.
JMS Module => JMS resources such as Queues, Topics and Connection factory are stored here
Connection Factory => It is a resource in JMS Module. Clients use Connection factory to connect to JMS server
Queue => It is a resource in JMS Module. A Point to point model messaging service that is One publisher and one subscriber
SubDeployement => It is a resource grouping mechanism. The queue and ConnectionFactoy are grouped together as sub deployment and targeted to the JMSServer.
This is continuation of WebLogic Cluster setup, if you are interested in that material please click on the following links
The WebLogic instance we are going to setup JMS server has two managed server instances which are part of a cluster as shown below.
Below are the Migratable targets of the two managed servers in the cluster which are created automatically during the cluster creation. The migratable target is present under Environment >> Clusters as shown below
Let’s begin to setup the weblogic migratable jms server
Configure Migratable Target for JMS Server
Configure the Cluster Migration basis to Consensus
1. Login into WebLogic admin console. Default URL is http://localhost:7001/console
2. Navigate to Environment >> Clusters >> Click on the (ClusterName)
3. Click on the Migration tab >> change the Migration Basis to ‘Consensus‘ >> Click the button Save
Configure ‘Auto-Migrate Exactly-Once Services in one of the Migratable Target in the cluster
1. Navigate to Environment >> Clusters >> Migratable Targets >> Click on one of the link in Migratable Targets
2. Click on the Migration tab and change the Service Migration Policy to ‘Auto-Migrate Exactly-Once Services‘
3. In the Constrained Candidate Servers, Move the server(s) from the Available to Chosen list to support failure recovery. Click on the button Save
Create a JMS Server & Persistent Store
1. Navigate to Services >> Messaging >> JMS Servers >> Click on the button New
2. Input a Name and click the button Next
3. Click on the button Create a New Store
4. Select File Store and Click Next
5. Input a Name and specify a location. Click Next
Note: Make sure the location is available on the server and it has Read & Write access.
6. Select the new_managedServer_1 (Migratable) and Click Finish.
6. Choose the Filestore in the persistent store we just created above and click Next
7. Select the target we chosen earlier. Click Finish
8. You will see the above message in top of the screen
Create a JMS Modules
1. Navigate to JMS Modules >> Click New
2. Input a Name and click Next
3. Select the cluster and click Next
4. Select the checkbox Would you like to add resources to this JMS system module? and click Finish
5. You will see the below text on top of your screen
Create a JMS Connection Factory
1. Navigate to Environment >> Services >> Messaging>> JMS Modules >> Click on the module we created earlier
2. Click New
3. Select Connection Factory and Click Next
4. Input a Name and JNDI Name
5. Select the cluster and Click on the button Finish
Create a JMS Queue & SubDeployement
1. Navigate to JMS Modules >> Click on the module we just created
2. Click New
3. Select Queue and Click Next (You can choose Topic instead of queue here)
4. Input a name and JNDI name
5. Click on the button ‘Create a New Subdeployement‘
6. Input a name and click Ok
7. Select the JMS Server and Click Finish
8. You will see the below message on top of the screen
JMS JNDI Names
We have configured the JMS in WebLogic server and setup JMS Queue. User/Client can access the QUEUE by the below JNDI names we just created.
Connection Factory: jms/JMSConnectionFactory
Restart the servers
Restart all the managed servers in the cluster
In the next post, I will explain about how to prodese and consume JMS Messages in java class.
The views expressed on this blog are my personal views and do not necessarily reflect the views of my employer.
Please feeling free to reach me on any comments and feedbacks you have. Would be more than glad to listen and reply 🙂
Latest posts by Govind
- JSF Login Logout Form Authentication Example - October 16, 2017
- How to Bookmark URL in JSF using GET method and ViewParam – example - October 14, 2017
- JSF Dynamic Navigation and how to use wildcard in navigation - October 12, 2017