The Client API Listening Ports

Introduction to StreamBase URIs

By default, EventFlow fragments launched either in StreamBase Studio or with epadmin assign the StreamBase Client API listening port to the traditional StreamBase value, 10000.

All StreamBase client API access, whether to Input Streams or from Output Streams, is managed by means of StreamBase URIss in the form sb://hostname:port, where the default hostname and port are sb://localhost:10000.

For example, the StreamBase client command sbc with its list option returns a report of StreamBase objects in the running fragment. For example:

sbc -u sb://sbserver.example.com/nnnnn list

If the machine hosting the server is the current machine, only the port needs to be specified:

sbc -p nnnnn list

If the machine is localhost, and the port number is the traditional default, 10000, then neither host nor port need to be stated. Thus:

sbc list

When connecting to an SSL/TLS-enabled StreamBase server, clients must use sbs://hostname:port.

Customer-provided client access programs written with the StreamBase Java or C++ client API use StreamBase URIs in client code.

Introduction to LiveView URIs

By default, LiveView fragments launched either in StreamBase Studio or with epadmin assign the LiveView Client API listening port to the traditional value, 10080.

All LiveView client API access uses LiveView URIs in the form lv://hostname:port, where the default hostname and port are lv://localhost:10080.

When connecting to an SSL/TLS-enabled LiveView server, clients must use lvs://hostname:port.

Setting the StreamBase Port in Studio

You can edit the Run Configuration for an EventFlow fragment to specify using a particular StreamBase listener port.

There is a chicken and egg problem here. You must run the fragment at least once with default settings in order to create and store a Run Configuration. When that is done, open the Run Configuration for the fragment you just ran with RunRun Configurations from Studio's top-level menu (or by using the drop-down menu to the right of the Run button in the Studio toolbar).

In the Run Configurations dialog, open EventFlow Fragment in the contents panel on the left, and select the name of the EventFlow module you just ran. The Main tab of that module's run configuration show the port selection options.

StreamBase engine port number

This control specifies the Client API listening port for the StreamBase server that runs as part of every EventFlow fragment launch. Choose one of the following options:

Configuration or default

This control specifies that the StreamBase listening port is assigned by a configuration file of type sbclientapilistener in the project's src/main/configurations folder. Or if no configuration file sets the StreamBase port for this project, then the default value of 10000 is used.

Any available

Select this control to specify any port not currently in use. This control is the same for Studio as setting portNumber = 0 in a configuration file.

Specified

Select this control to specify a particular port number for this EventFlow project's StreamBase server.

Learn more about using the Run Configurations dialog on Editing EventFlow Run Configurations.

Setting the StreamBase Port with Configuration

You can use a HOCON configuration file to specify a StreamBase listening port. Create and save such a configuration file in the src/main/configurations folder of your Studio project folder. The port specification is then used when the fragment is both by Studio (with the Configuration or default option selected) and when run with epadmin as part of running a Deployment Archive.

Specify a HOCON configuration file of type sbclientapilistener. The following shows an example of such a file that sets the listener port to an explicit value of 10011:

name    = "sbport"
version = 1.0.0
type    = "com.tibco.ep.streambase.configuration.sbclientapilistener"

configuration = {
    "ClientAPIListener" : {
        "apiListenerAddress" = {
            "portNumber" = 10011,
            "secure" = false
        }
    }
}

The following version sets the listener port to the value of a variable named SBPORT with a default value of 10011. You must specify a default value when specifying variable names.

name   = "sbport"
version= 1.0.0
type   = "com.tibco.ep.streambase.configuration.sbclientapilistener"

configuration = {
    "ClientAPIListener" : {
        "apiListenerAddress" : {
            "portNumber" : ${SBPORT:-10011},
            "secure" : false
        },
    }
}

You can specify a value for SBPORT on the epadmin node install command line using the substitutions parameter as shown in the following example. (This command is shown on multiple lines, but must be entered as one long command.)

epadmin install node 
  application=target/deploy_firstapp-0.0.1-SNAPSHOT-ep-application.zip 
  nodename=B.sbuser nodedirectory=/tmp/DTMout 
  substitutions="SBPORT=10025"

A subsequent epadmin servicename=B.sbuser display engine command shows the StreamBase port as 10025.

If you use a port-setting configuration file with a default value, then leave off the substitutions parameter, the fragment loads using the default port.

In this case, a subsequent epadmin servicename=B.sbuser display engine command shows the StreamBase port as 10011.

Determining the StreamBase Port in epadmin Launches

To determine the StreamBase listening port number for an EventFlow fragment running in a node installed and started with the epadmin command, run another epadmin command with the following syntax:

epadmin servicename=nodename.clustername display engine

For example:

epadmin servicename=B.sbuser display engine

The result is a list of the properties of the currently running engine that hosts the specified node. Look for the line whose property name is EventFlow Fragment Client URI. The value of that property is the full StreamBase URI of the EventFlow fragment running in that node. For example:

EventFlow Fragment Client URI   sb://sbhost.example.com:53599

If the server is running on the default sb://localhost:10000 URI, then

You can use a script or alias that accepts the servicename as an argument and uses grep (macOS and Linux) or find (Windows) to look for the line beginning with "EventFlow Fragment".

The servicename argument accepts a cluster name by itself. If you have launched several nodes with separate copies of an EventFlow fragment, or with separate fragments, each part of an overall StreamBase Runtime application, you can request the engine properties list of all nodes at once. For example:

epadmin servicename=sbuser display engine

Determining the StreamBase Port in Studio

Studio reports the StreamBase listening port in four locations:

1. In the blue information bar

When an EventFlow top-level module was successfully launched, it reports its status in a blue information bar across the upper left corner of the canvas. The full StreamBase URI is reported in this message, including the current port in use. If the server is running on the default port 10000, the port number is not shown. If the information bar is closed, hover over the blue i icon to see the URI.

2. In the Clusters view

In the Clusters and Nodes pane on the left, select the Engine line for the currently running node. On the right, look for EventFlow Fragment Client URI, which shows the full URI, including port number.

3. When hovering over the Running icon

The Running icon is in the lower left corner of the Studio window, and shows a green arrowhead when a fragment is running. Hover the cursor over this icon to see a brief report that includes the StreamBase URI with port.

4. In the Console view log

One of the information lines shown in the Console view for a successful fragment launch reports the status of the StreamBaseHTTPServer subsystem. Immediately following is the hostname and listening port.

The following image shows the approximate location in the SB Test/Debug perspective of the four reporting locations, numbered as in the list above.

Setting and Determining the LiveView Port

The methods of setting and determining the client API listening port for LiveView servers are analogous to the methods for StreamBase servers described in the previous sections.

Setting the LiveView Port in Studio

Edit the Run Configuration for a LiveView fragment to specify using a particular port. For LiveView fragments, you can independently set the port for the StreamBase server that underlies and supports LiveView, and the port for the LiveView server itself.

See the description of the Main tab of the Run Configurations dialog for LiveView servers.

Setting the LiveView Port with Configuration

Specify a HOCON configuration file of type ldmclientapilistener. The following shows an example of such a file that sets the listener port to an explicit value of 10088:

name = "ldmport"
version = "1.0.0"
type = "com.tibco.ep.ldm.configuration.ldmclientapilistener"

configuration = {
  ClientAPIListener = {
    portNumber = 10088
    secure = false
  }
}

You can use a substitution variable for the port number as described in Setting the StreamBase Port with Configuration and in Substitution Variables. The ldmclientapilistener configuration type is described in Reference for Live Datamart Client API Listener Configuration.

Determining the LiveView Port in epadmin Launches

To determine the listening port number for a LiveView fragment running in a node installed and started with the epadmin command, run another epadmin command like the following example:

epadmin servicename=B.sbuser display engine

In the resulting list of properties, look for the line whose property name is LiveView Fragment Client URI. The value of that property is the full LiveView URI of the EventFlow fragment running in that node. For example:

LiveView Fragment Client URI   sb://sbhost.example.com:53599

Use grep (macOS and Linux) or find (Windows) to look for the line beginning with "LiveView Fragment".

Determining the LiveView port in Studio

Studio reports the LiveView listening port in two locations:

1. In the Clusters view

In the Clusters and Nodes pane on the left, select the Engine line for the currently installed and started node. On the right, look for LiveView Fragment Client URI, which shows the full URI, including port number.

2. In the Console view log

One of the information lines shown in the Console view for a successful fragment launch reports a line such as "LiveView Web service listening on non-SSL port 10080".