Skip to main content

Web Gateway Registry in InterSystems IRIS

The InterSystems Web Gateway Registry registers each connected Web Gateway installation with InterSystems IRIS® and provides the infrastructure to allow InterSystems IRIS code to interact with those installations (to clear caches and so on). Such programmatically controlled interactions may include reading and modifying the Web Gateway’s runtime configuration and collecting system status and log information. The relevant classes are as follows:

%CSP.Mgr.GatewayRegistry (The Gateway Registry)
%CSP.Mgr.GatewayMgr  (A Connected Gateway)

The following code lists all connected (i.e. active) Web Gateway installations and writes the web server IP address, port and Web Gateway build number to the console window.

Set reqistry = $system.CSP.GetGatewayRegistry()
Set gateways = reqistry.GetGatewayMgrs()
For no=1:1:gateways.Count() {
     Set gateway = gateways.GetAt(no)
     Write !,no, " : "
     Write gateway.IPAddress,":",gateway.Port," ",gateway.Version

When InterSystems IRIS is first started this list is empty. As Administrator and User activity increases, expect at least two entries to appear: one for the private web server serving the Management Portal and at least one for external web servers supporting applications.

You can find further documentation associated with the classes listed above. Some code examples follow to illustrate common tasks.

List Default Parameters

Kill defaults
Do gateway.GetDefaultParams(.defaults)
ZWrite defaults

Update Default Parameter(s)

Kill newpars
Set newpars("Server_Response_Timeout")=30
Do gateway.SetDefaultParams(.newpars)

List Servers

Set status = gateway.GetServers(.servers)
For no=1:1:$ListLength(servers) {
     Set server = $List(servers,no)
     Write !,no, " : ",server

List Server Parameters

Kill serverpars
Do gateway.GetServerParams("LOCAL",.serverpars)
ZWrite serverpars

Update Server Parameter(s)

Kill newpars
Set newpars("Maximum_Server_Connections")=250
Do gateway.SetServerParams("LOCAL",.newpars)

List Application Paths

Set status = gateway.GetApplicationPaths(.paths)
For no=1:1:$ListLength(paths) {
     Set path = $List(paths,no)
     Write !,no, " : ",path

List Application Parameters

Kill pathpars
Do gateway.GetApplicationParams("/csp",.pathpars)
ZWrite pathpars

Update Application Parameter(s)

Kill newpars
Set newpars("GZIP_Compression")="Enabled"

Clear Gateway cache

Do gateway.ClearCache("*")

Forcing the Web Gateway to Reload Its Configuration

There are occasions when the Web Gateway’s configuration is modified by external agents (i.e. agents other than the Web Gateway’s own Systems Management Suite).

There are two methods for interactively instructing the Web Gateway to reload its configuration, and in a way that doesn’t require a complete restart.

Using the InterSystems IRIS Web Gateway Registry

The following Registry Method is provided:

Set status = %CSP.Mgr.GatewayMgr.ActivateCSPIni()

When successfully called, the Web Gateway reads its configuration file and activates all changes made.

Using Scripts External to InterSystems IRIS

Scripts should add the following line (case-sensitive) to the SYSTEM section of the modified Web Gateway configuration file:


The Web Gateway caretaker daemon checks the RELOAD flag approximately every minute and, if correctly set, reloads and reactivates its configuration and removes the flag from the file. The following message is written to the Event Log after a successful reload operation:

Gateway Management 
Gateway Configuration Reloaded and Reactivated