- Index

< Previous |  | Next >

# Runtime 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.dtm.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]" ]

  discoveryPort

    Int. The port to use for discovery requests. This property is optional and defaults to the port used by the node where this configuration is loaded.

    For example:

        discoveryPort = 54321

  discoveryBrowseIntervalSeconds

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

    For example:

        discoveryBrowseIntervalSeconds = 1

  discoveryHosts

    String. An array of host names that specify which network interfaces to use when sending discovery requests. This optional array defaults to the system's host name.

    For example:

        discoveryHosts = [ ]

  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 = "cluster-monitor-service-discovery"
    version = "1.0.0"
    type = "com.tibco.ep.streambase.configuration.servicediscoveryadapter"
    configuration =
    {
      ServiceDiscovery =
        {
           associatedWithEngines = [ "cluster-monitor" ]
           //
           // The port to use for discovery requests.
           // Optional. Defaults to the port being used by the node where
           // this configuration is loaded.
           //
           // discoveryPort = 54321
           //
           // A list of host names that specify which network interfaces
           // to use when sending discovery requests.
           // Optional. Defaults to the system's host name.
              discoveryHosts = [ ]
           //
           // Service names that will be discovered by the cluster monitor.
           // Optional. Defaults to all service names found.
           // Uncomment to restrict.
           //
           // serviceNames = [ "cluster1", "cluster2", "nodeA.cluster3" ]
           //
           // Service types that will be discovered by cluster monitor.
           // Optional. Empty defaults to all service types, but the cluster
           // monitor only knows how to monitor node, eventflow and
           // liveview services.
           //
              serviceTypes = [ "node", "eventflow", "liveview" ]
           //
           // The number of seconds between discovery requests.
           // Optional. Defaults to 1.
           //
           // discoveryBrowseIntervalSeconds = 1
           //
           // This causes the cluster-monitor event flow application
           // to wait for the LiveView server to become ready before
           // starting.  Do not change.
           //
              autostart = false
           //
           // Whether or not services running within the monitor's node
           // are discovered and monitored.
           // Defaults to false.
           //
              includeLocalServices = ${INCLUDE_LOCAL_SERVICES:-false}
        }
    }