Runtime Configuration

 

 

Runtime configuration is an important part of the KonfDB Host.  The runtime configuration decides the hosting behaviour of the KonfDB service.  In this post, we will look at each configuration parameter in detail.

Sample Runtime Configuration

The sample runtime configuration is as below

"runtime": {
    "audit": true,
    "logConfigPath": "",
    "securityMode": "None",
    "server": [
      {
        "port": 8885,
        "type": "TCP"
      },
      {
        "port": 8880,
        "type": "HTTP"
      },
      {
        "port": 8890,
        "type": "WSHTTP"
      },
      {
        "port": 8882,
        "type": "REST"
      }
    ],
    "superuser": {
      "username": "suser",
      "password": "spwd"
    }
  }

 

Mode

The mode attribute accepts two values – Server and Client.

Server mode

Server mode is the default mode and should be used when KonfDBH (host service) is running as Windows Service.  This is highly efficient mode that enables one or more communication channels.  When mode attribute is set to server, following configuration is considered for the runtime engine

"server": [
      {
        "port": 8885,
        "type": "TCP"
      },
      {
        "port": 8880,
        "type": "HTTP"
      },
      {
        "port": 8890,
        "type": "WSHTTP"
      },
      {
        "port": 8882,
        "type": "REST"
      }
    ]

This section defines the communication channels.  In the above example, KonfDB service will host the service on 3 end points (channels)

  • TCP end-point on port 8085
  • HTTP end-point on port 8080
  • REST end-point on port 8082

Each end-point will be accessible via different URLs

Type Port URL
TCP 8085 net.tcp://localhost:8085/CommandService/
HTTP 8080 http://localhost:8080/CommandService/
REST 8082 http://localhost:8082/CommandService/

Client Mode

Unlike Server mode, Client mode is designed to run KonfDBH (host) as a Console Application.  This mode should not be used in production.  Client mode provides only one communication (one of HTTP, TCP, REST) channel at a time.

When mode attribute is set to client, following configuration is considered by the runtime engine


 "client": {
      "host": "localhost",
      "port": 8885,
      "type": "TCP"
    }

The service URL follows the same convention as in the Server mode

logConfigPath

A fully qualified path of log4net configuration file should be mentioned.

If this value is empty, a Logs folder will be created in the directory of KonfDB Host. For example, if the KonfDB host is running on C:\KonfDB\KonfDBH then the logs directory will be C:\KonfDB\KonfDBH\Logs

audit

If the attribute audit is set to true, commands that change a suite’s configuration or provide/revoke access to a user will be audited.  Enabling audit can be harmful if there are multiple sources of update in the configuration.  Retrieval of configuration does not have any negative impact in on the performance of the application.

superuser

super user is the username through which KonfDB will be running.  This user will also be automatically added to all suites as admin. The name attribute is used to specify the name of the user whereas, password is specified to mention the password for user.

These credentials should not be made available to any user other than the administrator.  There is no mode of recovery of the password should you forget the password.