StreamBase Service Discovery Configuration

Overview

This article provides a reference for writing a StreamBase Runtime servicediscoveryadapter configuration file, which is used to discover services running in a StreamBase Runtime fabric. This configuration type is intended to be used in conjunction with the clustermonitor configuration type as a component of cluster monitoring. See Cluster Monitor Application for more information regarding the StreamBase-provided Cluster Monitoring application.

Required Header Lines

Each configuration file must contain the following header lines, typically found at the beginning of each file:

name

Specifies an arbitrary, case-sensitive string to name this configuration, which must be unique among other files with the same type, if any. Configuration files can refer to each other by this name. Select a name that reminds you of this configuration's type and purpose. For example:

name = "FullAppConfig"
version

Specifies an arbitrary version number that you can use to keep track of file versions for this configuration type in your development project. The maintenance of version numbers is under user control; StreamBase does not compare versions when loading configuration files during the fragment launch process. The version number is a string value, and can contain any combination of characters and numbers. For example:

version = "1.0.0"
type

This essential setting specifies the unique HOCON configuration type described on this page.

type = "com.tibco.ep.streambase.configuration.servicediscoveryadapter"

The three header lines taken together constitute a unique signature for each HOCON file in a project's configurations folder. Each project's configurations folder can contain only one file with the same signature.

The top-level configuration object defines the configuration envelope the same way for all HOCON file types.

configuration

On a line below the header lines, enter the word configuration followed by an open brace. The configuration object is a sibling of the name, version, and type identifiers, and serves to define the configuration envelope around this type's objects as described on this page. The file must end with the matching close brace.

configuration = {
...
...
}

HOCON Properties Explained

This section provides detailed descriptions for all properties in each configuration object.

ServiceDiscovery

Top-level object for this configuration type.

associatedWithEngines

If you want to restrict this object to be associated with specific engines, do so here. Each entry can be a specific engine name or a regular expression that can applies to more than one engine. This object is optional and has no default value. If not present, the configuration uses default engine association based on its location in a fragment or application archive, or in a node deploy configuration.

For example:

[ "javaengine", "otherengine[0-9]" ]
discoveryBrowseIntervalSeconds

Int. The number of seconds between discovery broadcast requests. This property is optional and defaults to 1.

For example:

discoveryBrowseIntervalSeconds = 1
serviceTypes

String. A list of service types to discover. This array is optional and has no default value.

For example:

serviceTypes = [ "node", "cluster", "distribution" ]
serviceNames

String. A list of fully and partially qualified service names to discover. This array is optional and defaults to all service names.

For example:

serviceNames = [ "cluster", "node.cluster", "distribution.node.cluster" ]
autostart

Bool. This causes the Cluster Monitor EventFlow application to wait for the LiveView server to become ready before starting. Changing this setting is not recommended.

For example:

autostart = false
includeLocalServices

This optional property sets whether to include discovery of services running in the local node. Defaults to false.

For example:

includeLocalServices = false

Configuration File Sample

The following example is based on the default configuration file used in the Cluster Monitor application.

name = "service-discovery"
version = "1.0.0"
type = "com.tibco.ep.streambase.configuration.servicediscoveryadapter"
configuration = {
  ServiceDiscovery = {
    associatedWithEngines = [ "javaengine", "otherengine[0-9]" ]
    discoveryBrowseIntervalSeconds = 1
    serviceTypes = [ "node", "cluster", "distribution" ]
    serviceNames = [ "cluster", "node.cluster", "distribution.node.cluster" ]
    autostart = true
    includeLocalServices = true
  }
}