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
This setting should only be used in combination with a server that does not run a DataMiner Agent, for example, servers hosting a DMZ setup for dataminer.services connectivity or Dashboard Gateway.
For DxMs, check the release notes of the specific DxM to find out from which version this is supported. The Data Aggregator DxM does not work in combination with
ForcedEndpoints.
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
CredentialsUrlto retrieve the NATS credentials. - Use only the endpoints listed in
ForcedEndpointsto 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.