Skip to content

Configuration

SapiConfig

Main configuration class for connecting to KX Sensors.

Field Type Description
instanceName String Instance name, which can be used to differentiate multiple clients. Defaults to a unique value.
connTimeout int Timeout in milliseconds for waiting a gateway successfully connects. -1 will wait forever.
bridgeTimeout int Timeout in milliseconds for waiting a gateway successfully connects. -1 will wait forever.
domain String Domain class
serviceClass String Service class
family String Data family
addrs String[] Network interface addresses and ports
version int KX Sensors client version number. Defaults to 100 indicating v1.0.
buildInfo String Build information
username String KX Sensors user ID associated with issued requests. Defaults to 0.
password String Password
udpPort int UDP port if used
discoveryHosts String[] Discovery servers address and port
gatewayHosts String[] Gateway servers address and port
scs String[] Service classes of interest to client
listenHosts String[] Hosts used to bind local TCP server to accept incoming connections
listenPorts String Ports used to accept incoming connections, e.g. 8000-8010
advertiseHosts String[] Hosts advertised as accepting incoming connections
advertisePorts String Ports advertised as accepting incoming connections
retryPolicy RetryPolicy Retry Policy strategy settings, null means no retry.
rtConfig SapiRtConfig RT configuration.
socketConfig SapiSocketConfig Socket configuration
tls SapiTLS TLS configuration
gatewayStrategy short Gateway strategy used for determining destination Gateway.
gwWorkersCount short Number of GW worker threads
rpWorkersCount short Number of RP worker threads
mqWorkersCount short Number of MQ worker threads
pubWorkersCount short Number of publish worker threads
dsWorkersCount short Number of DS worker threads
reqMaxPending int Maximum number of in flight API requests
reqMaxPendingBlock Boolean Enable blocking requests after pending threshold is reached, otherwise request is rejected with AC.LIMIT
useTLS Boolean Enable SSL for remote process connections

RetryPolicy

Configuration for retry logic in case of operation failures.

Field Type Description
maxAttempts int Maximum attempts before timing out
timeout int Timeout for each attempt in milliseconds
retryInterval int Interval between retries in milliseconds
retryScaling float Backoff multiplier (>= 1.0)

SapiSocketConfig

Socket configuration parameters.

Field Type Description
socRoundTripTime int Maximum expected round-trip time in milliseconds
socSendRate int Send rate per connection (bytes/sec)
socReceiveRate int Receive rate per connection (bytes/sec)

SapiTLS

TLS configuration parameters for secure communication.

Field Type Description
CA String TLS CA certificate
CAFile String Path to CA certificate file
cert String TLS certificate
certFile String Path to TLS certificate file
key String Certificate private key
keyFile String Path to private key file
verifyClient Boolean Enable verification of incoming certificates
verifyServer Boolean Enable verification of outgoing certificates

SapiRtConfig

Configuration parameters for Reliable Transport (RT).

Field Type Description
useBridge Boolean Enables bridge connection
configUrl String URL or file path for endpoint configuration
configPath String Path for local configuration
clientName String Client identifier
prefix String Prefix for RT resources
stream String Stream identifier
clientType String Client type (default: "pub")
endPoints String Endpoint identifiers
rtPort String RT port number
rtDir String Directory for RT logs
caInfoFile String CA certificate bundle path
configMaxAge int Max age for config data (ms)
fetchConfigSleep int Interval between config fetches (ms)
localPersistencePeriod int Local data persistence period (ms)
connTimeout int Timeout for RT connection (ms)