Configuration
The DCX loads configuration data from a file (typically backed by a Kubernetes config map). The location of the configuration file is sourced from an environment variable. If the service is unable to retrieve the configuration data, it will not start. Refer to the configuration for details.
Service configuration structure
The recommended configuration format is YAML. The below sections describe the officially supported configuration options that influence various aspects of the service functionality. The service may support options other than the ones listed below, but those are not a part of the public API and may be changed or deleted at any time.
General
DCX uses its service instance name and replica ID for communication with other services and load balancing across replicas (for example, see 3/ISM). You can control the values with the following configuration options:
service:
instance:
name: <string> # Service instance name, should be unique cluster-wide. "dcx" by default.
replica.id: <string> # Service instance replica ID, should be unique cluster-wide. Random string by default.
graceful-shutdown: <uint> # Allowed service graceful shutdown period in seconds. 30 seconds by default.
Reliable data receivers
DCX broadcasts data samples received from endpoints to data receivers using 13/DSTP. You can configure DCX to treat some receivers as reliable.
In case there are reliable receivers configured and the client data contains a non-empty requestID
, DCX waits for processing confirmation from each reliable receiver before responding back to the communication service.
If any of the reliable receivers do not respond until the timeout or respond with a failure, DCX delivers an appropriate error code back to the communication service.
If no reliable receivers are configured, DCX immediately responds to the EP with a success status. It also ignores error processing responses from non-reliable receivers.
To configure reliable receivers, use the following options:
kaa:
dcx:
data-receivers:
reliable: # List of service instance names of reliable receivers
- <service instance name>
confirmation-timeout: <integer> # Maximum duration in milliseconds to wait for response from all reliable receivers. 5 seconds by default.
Kaa applications
Many Kaa services can be configured for different behavior depending on the application version of the endpoint the processed data relates to.
This is called appversion-specific behavior and is handled in service configurations under kaa.applications
. Despite DCX currently does not support any appversion-specific configurations, it uses the application and appversion names to validate the API calls and protocols data.
kaa:
applications:
<application 1 name>: # Kaa application name
versions:
<application 1 version 1 name>: # Kaa application version name
NATS
The below parameters configure DCX’s connection to NATS broker, as well as the NATS message adapters used by DCX. Note that for security reasons NATS username and password are sourced from the environment variables.
nats:
urls: <comma separated list of URL> # NATS connection URLs
kaa:
esp.server:
concurrency: <uint> # Number of concurrent workers to read messages from communication service. 8 by default.
queue-length: <uint> # The maximum amount of messages in the ESP server queue. When the queue is full, new messages will be dropped. 16 * `kaa.esp.server.concurrency` by default.
dstp.transmitter:
concurrency: <uint> # Number of concurrent workers to read messages from data receivers. 8 by default.
queue-length: <uint> # The maximum amount of messages in the DSTP transmitter queue. When the queue is full, new messages will be dropped. 16 * `kaa.dstp.transmitter.concurrency` by default.
Consider configuring concurrency options to at least match the number of CPUs available on your infrastructure.
Monitoring
To control the DCX management interface, use the following configuration options.
service.monitoring:
disabled: <boolean> # Disables the monitoring interface entirely. False by default.
port: <uint> # TCP port to expose the monitoring server on. 8080 by default.
Logging
DCX writes logs to stdout
.
By default, the service only produces logs at startup, shutdown, or in case of errors.
To enable debug level logging, use the following option:
service:
debug: <boolean> # Enables debug level logging, false by default
Keep in mind that enabling debug level logging will produce significantly more log output and degrade the service performance.
Default configuration
Summarizing the above, the default DCX configuration is as follows. Note that no Kaa applications are defined by default—you have to configure those for any specific Kaa-based solution.
service:
instance:
name: "dcx"
replica.id: "<random string generated on boot>"
monitoring:
disabled: false
port: 8080
graceful-shutdown: 30 # seconds
kaa:
esp.server:
concurrency: 8
queue-length: 128
dstp.transmitter:
concurrency: 8
queue-length: 128
dcx:
data-receivers:
reliable: # none
confirmation-timeout: 5000 # milliseconds
applications: # none; at least one must be configured to start
nats:
urls: nats://nats:4222