Sunday 18 November 2018

WebLogic Message Unit-of-Order explanation

Example for UOE(Unit Of Order)
Somebody enter in a web application (store) for buying a book and choose a book (M1= message number 1). After that, that person immediately cancel 
that action (M2= message number 2).
In this case the following things may happen:
   1) MDB 1(Message Driven Beans 1) read the first message (M1) and start processing that message.
   2) MDB2 (Message Driven Beans 2) read the second message (M2) and start processing that message.
   3) For some reasons (MDB2 run faster than MDB1), MDB2 try to cancel that operation by sending a "DELETE" operation to the database, 
but nothing happen, because MDB1 didn't "INSERT" that operation to the database.
   4) MDB1 "INSERT" that operation to the database.
At the end the book appears in the database as "INSERTED", so that book will be sent to the person who wanted it at the beginning (but is no longer needed).
In order to avoid this problem, WebLogic introduce the concept of Unit-of-Order

With this concept, more messages are associated with an ID (UOO).

The Message Unit-of-Order enforces the order of messages with the same key so that the messages are consumed in the order they were added to the queue.
Here is the behaviour we can have for the example above, if M1 and M2 have the same Message Unit-of-Order:

  • MDB 1(Message Driven Beans 1) read the first message (M1) and start processing that message.
  • MDB2 (Message Driven Beans 2) read the second message (M2) and wait for the M1 to complete.
  • MDB1 "INSERT" that operation to the database and complete the execution and MDB2 start processing that message and send a "DELETE" 
operation to the database.
All Set now.

WebLogic Machine

A machine is a logical representation of the physical machine (computer) that hosts one or more WebLogic Server instances.

Oracle WebLogic Machine configuration:

If you want to run Node Manager on a machine that does not host an Administration Server, as is typical in production environments, you must create a machine configuration for each computer that runs a Node Manager process. The machine configuration includes information about the listen address and port number that the Administration Server uses to connect with the Node Manager process running on that machine.

Here are the steps for enrolling a WebLogic Node Manager with a domain.

For configuring the WebLogic Machine you have to go to the 
Domain Structure / Environment / Machines and now choose a machine.

Then click on Admin Server can communicate with the Node Manager on that machine. 
In this case the Node Manager Status is "Reachable":

The main configurations for the machine is to set the Node Manager settings :
Now on the "Servers" tab you can see the servers running on that machine as well :


Use of Node Manager:

  • A Node Manager process is not associated with a specific WebLogic domain but with a machine.
  • You can use the same Node Manager process to control server instances in any WebLogic  Server domain, as long as the server instances reside on the same machine as the Node  Manager process.
  • Node Manager must run on each computer that hosts WebLogic Server instances. whether Administration Server or Managed Server that you want to control with  Node Manager.
 Start & Stop the Node Manager:

  • To Start Node Manager: $WL_HOME\server\bin\startNodeManager.sh
  • To Stop Node Manager: There is no script to stop NodeManager, you need to find process ID of Node Manager and kill it.  Kill – 9 <PID>

Oracle WebLogic Subdeployment

The JMS Module resources can be deployed on a particular JMS Server.

Standalone queues or topics can only be targeted to a single JMS server. Whereas, connection factories, uniform distributed destinations (UDDs), and foreign servers can be targeted to one or more JMS servers, one or more server instances, or to a cluster. Therefore, standalone queues or topics cannot be associated with a subdeployment if other members of the subdeployment are targeted to multiple JMS servers. However, UDDs can be associated with such subdeployments since the purpose of UDDs is to distribute its members to multiple JMS servers in a domain.

For this reason, in a WebLogic JMS Module we can define a subdeployment.

Each subdeployment has a particular target !!!
To see the subdeployments we have for a JMS Module, we can open the WebLogic Administration Console, go to the Domain Structure -> Services -> Messaging -> JMS Module. Click on a JMS Module and after that click on the "Subdeplyments" tab. On this page we can see the combination of subdeployments, resources and targets:


Click a subdeployment to see the possible targets for that subdeployment:


You can see that a target could be an Admin Server, a Managed Server, a WebLogic Cluster or a WebLogic JMS Server.

WebLogic Virtual Host

Virtual hosting :

It is the ability to run multiple web sites ( for instance www.google.com and www.google2.com) on a single web server. 

Name-based virtual hosting implies that you map multiple domain names or logical hosts to the same IP address. 

WebLogic Server allows you to create a virtual host for any number of different domain names.
To configure the DNS server that the www.google.com and www.google2.com return the same IP address 

The WebLogic instance you have to create 2 virtual hosts for the 2 sites and here is the  configuration page of a Virtual host.

Monitor virtual hosts:

To check status of a monitor virtual host:
From the WebLogic Domain dropdown menu, select Environment, then select Virtual Hosts.

The Virtual Hosts table displays information about each virtual host that has been configured in the current domain, including:

  • Name
  • Virtual Host Names
  • Network Access Point
  • Frontend Host
  • Frontend HTTP Port
  • Frontend HTTPS Port