Table of Contents

Configuring forced NATS endpoints

To make all processes on a server connect to specific custom NATS endpoints instead of the ones automatically provided by BrokerGateway, you can use the ForcedEndpoints setting in MessageBrokerConfig.json. This is useful in scenarios where a process must reach NATS through a fixed set of endpoints.

When you configure this, the CredentialsUrl setting in this same JSON file will still be used to fetch credentials and endpoints from BrokerGateway, but the endpoints returned in that response will be ignored.

Prerequisites

Configuration

To override the NATS endpoints for all processes on a server, add a ForcedEndpoints array to the BrokerGatewayConfig section in C:\ProgramData\Skyline Communications\DataMiner\MessageBrokerConfig.json:

{
  "BrokerGatewayConfig": {
    "CredentialsUrl": "https://<hostname>/BrokerGateway/api/natsconnection/getnatsconnectiondetails",
    "APIKeyPath": "C:\\Program Files\\Skyline Communications\\DataMiner BrokerGateway\\appsettings.runtime.json",
    "ForcedEndpoints": [ "custom-host-1:4222", "custom-host-2:4222", "custom-host-3" ]
  }
}

Each entry in ForcedEndpoints can be a string in the format "host:port" or "host".

Behavior

When ForcedEndpoints is set, the process will:

  • Still call CredentialsUrl to retrieve the NATS credentials.
  • Use only the endpoints listed in ForcedEndpoints to connect to NATS, ignoring any endpoints returned by BrokerGateway.
    • The order of endpoints determines the connection preference and fallback order.
    • These endpoints do not need to be a subset of the known IPs of BrokerGateway.

When ForcedEndpoints is absent or empty, normal behavior applies and the endpoints are resolved through BrokerGateway.

Advanced search syntax