Skip to main content

Problem:

  • Product Name: VisiBroker
  • Product Version: 6.x and later
  • Product Component: Server Manager

Is it possible to programmatically check the number of connections opened at a Server dynamically?

Resolution:

VisiBroker has the facility to show the run-time state of the Server ORB which can be queried from through the Server Manager's container. You can write a VisiBroker Client that call the Server Manager APIs to query the connections information dynamically.

Please read the following chapter to have a proper understanding of the Server Manager feature:

Using the VisiBroker Server Manager

The statistics related to Server-side resource usage is documented here:

Properties showing run-time status of Server

For example, you can query the following connection related statistics through the Server Manager's container:

  • vbroker.se.<SE_name>.scm.<SCM_name>.manager.inUseConnections - The number of incoming connections for which there are requests executing in the ORB.
  • vbroker.se.<SE_name>.scm.<SCM_name>.manager.idleConnections - The number of incoming connections for which there are not any requests currently being executed in the ORB.

A VisiBroker Server ORB may be configured to have multiple SCMs, and each SCM has its own set of statistics. So you need to specify the exact <SE_name> and <SCM_name> you require. The default <SE_name> and <SCM_name> are "iiop_tp" and "iiop_tp" respectively.

The sample Java code snippet below teaches you how to query for the “inUseConnections“ and “idleConnections” statistics. The target VisiBroker Server which is being queried must set "vbroker.orb.enableServerManager=true":

 

// Additional import to use Server Manager API

import com.inprise.vbroker.ServerManager.ContainerPackage.*;

import com.inprise.vbroker.ServerManager.*;

.......

 

// Assume you have access to "VB_Obj", which is a VisiBroker Server Object reference which you want to query.

// Assume your required <SE_name> = "iiop_tp" and <SCM_name> = "iiop_tp".

Container topContainer = ContainerHelper.narrow(VB_Obj._resolve_reference("ServerManager"));

Container orbCont = topContainer.get_container("ORB").value;

Container iiopCont = orbCont.get_container("ServerEngines").value;

// Substitute "iiop_tp" with your required <SE_name>

iiopCont = iiopCont.get_container("iiop_tp").value;

// Substitute "iiop_tp" with your required <SCM_name>

iiopCont = iiopCont.get_container("iiop_tp").value;

// Substitute with your required <SE_name> and <SCM_name>

Property inUseConnectionsProp=iiopCont.get_property("vbroker.se.iiop_tp.scm.iiop_tp.manager.inUseConnections");

// Substitute with your required <SE_name> and <SCM_name>

Property idleConnectionsProp=iiopCont.get_property("vbroker.se.iiop_tp.scm.iiop_tp.manager.idleConnections");

System.out.println("Server inUseConnections = " inUseConnectionsProp.value.extract_long());

System.out.println("Server idleConnections = " idleConnectionsProp.value.extract_long());

System.out.println("Server Total Connections = " (inUseConnectionsProp.value.extract_long() idleConnectionsProp.value.extract_long()) );

Support Incident # 2699894

 


#connection
#VisiBroker
#Security
#ServerManager
#idleConnections
#inUseConnections