Skip to main content
Version: Develop

Core Configuration

INX-MQTT uses a JSON standard format as a config file. If you are unsure about JSON syntax, you can find more information in the official JSON specs.

You can change the path of the config file by using the -c or --config argument while executing inx-mqtt executable.

For example:

inx-mqtt -c config_defaults.json

You can always get the most up-to-date description of the config parameters by running:

inx-mqtt -h --full

1. Application

NameDescriptionTypeDefault value
checkForUpdatesWhether to check for updates of the application or notbooleantrue
shutdownConfiguration for shutdownobject

Shutdown

NameDescriptionTypeDefault value
stopGracePeriodThe maximum time to wait for background processes to finish during shutdown before terminating the appstring"5m"
logConfiguration for logobject

Log

NameDescriptionTypeDefault value
enabledWhether to store self-shutdown events to a log filebooleantrue
filePathThe file path to the self-shutdown logstring"shutdown.log"

Example:

  {
"app": {
"checkForUpdates": true,
"shutdown": {
"stopGracePeriod": "5m",
"log": {
"enabled": true,
"filePath": "shutdown.log"
}
}
}
}

2. Logger

NameDescriptionTypeDefault value
levelThe minimum enabled logging levelstring"info"
disableCallerStops annotating logs with the calling function's file name and line numberbooleantrue
disableStacktraceDisables automatic stacktrace capturingbooleanfalse
stacktraceLevelThe level stacktraces are captured and abovestring"panic"
encodingThe logger's encoding (options: "json", "console")string"console"
outputPathsA list of URLs, file paths or stdout/stderr to write logging output toarraystdout
disableEventsPrevents log messages from being raced as eventsbooleantrue

Example:

  {
"logger": {
"level": "info",
"disableCaller": true,
"disableStacktrace": false,
"stacktraceLevel": "panic",
"encoding": "console",
"outputPaths": [
"stdout"
],
"disableEvents": true
}
}

3. INX

NameDescriptionTypeDefault value
addressThe INX address to which to connect tostring"localhost:9029"
maxConnectionAttemptsThe amount of times the connection to INX will be attempted before it fails (1 attempt per second)uint30

Example:

  {
"inx": {
"address": "localhost:9029",
"maxConnectionAttempts": 30
}
}

4. MQTT

NameDescriptionTypeDefault value
bufferSizeThe size of the client buffers in bytesint0
bufferBlockSizeThe size per client buffer R/W block in bytesint0
subscriptionsConfiguration for subscriptionsobject
websocketConfiguration for websocketobject
tcpConfiguration for TCPobject

Subscriptions

NameDescriptionTypeDefault value
maxTopicSubscriptionsPerClientThe maximum number of topic subscriptions per client before the client gets dropped (DOS protection)int1000
topicsCleanupThresholdCountThe number of deleted topics that trigger a garbage collection of the subscription managerint10000
topicsCleanupThresholdRatioThe ratio of subscribed topics to deleted topics that trigger a garbage collection of the subscription managerfloat1.0

Websocket

NameDescriptionTypeDefault value
enabledWhether to enable the websocket connection of the MQTT brokerbooleantrue
bindAddressThe websocket bind address on which the MQTT broker listens onstring"localhost:1888"
advertiseAddressThe address of the websocket of the MQTT broker which is advertised to the INX Server (optional).string""

TCP

NameDescriptionTypeDefault value
enabledWhether to enable the TCP connection of the MQTT brokerbooleanfalse
bindAddressThe TCP bind address on which the MQTT broker listens onstring"localhost:1883"
authConfiguration for authobject
tlsConfiguration for TLSobject

Auth

NameDescriptionTypeDefault value
enabledWhether to enable auth for TCP connectionsbooleanfalse
passwordSaltThe auth salt used for hashing the passwords of the usersstring"0000000000000000000000000000000000000000000000000000000000000000"
usersThe list of allowed users with their password+salt as a scrypt hashobject[]

TLS

NameDescriptionTypeDefault value
enabledWhether to enable TLS for TCP connectionsbooleanfalse
privateKeyPathThe path to the private key file (x509 PEM) for TCP connections with TLSstring"private_key.pem"
certificatePathThe path to the certificate file (x509 PEM) for TCP connections with TLSstring"certificate.pem"

Example:

  {
"mqtt": {
"bufferSize": 0,
"bufferBlockSize": 0,
"subscriptions": {
"maxTopicSubscriptionsPerClient": 1000,
"topicsCleanupThresholdCount": 10000,
"topicsCleanupThresholdRatio": 1
},
"websocket": {
"enabled": true,
"bindAddress": "localhost:1888",
"advertiseAddress": ""
},
"tcp": {
"enabled": false,
"bindAddress": "localhost:1883",
"auth": {
"enabled": false,
"passwordSalt": "0000000000000000000000000000000000000000000000000000000000000000",
"users": null
},
"tls": {
"enabled": false,
"privateKeyPath": "private_key.pem",
"certificatePath": "certificate.pem"
}
}
}
}

5. Profiling

NameDescriptionTypeDefault value
enabledWhether the profiling plugin is enabledbooleanfalse
bindAddressThe bind address on which the profiler listens onstring"localhost:6060"

Example:

  {
"profiling": {
"enabled": false,
"bindAddress": "localhost:6060"
}
}

6. Prometheus

NameDescriptionTypeDefault value
enabledWhether the prometheus plugin is enabledbooleanfalse
bindAddressThe bind address on which the Prometheus HTTP server listens onstring"localhost:9312"
mqttMetricsWhether to include MQTT metricsbooleantrue
goMetricsWhether to include go metricsbooleanfalse
processMetricsWhether to include process metricsbooleanfalse
promhttpMetricsWhether to include promhttp metricsbooleanfalse

Example:

  {
"prometheus": {
"enabled": false,
"bindAddress": "localhost:9312",
"mqttMetrics": true,
"goMetrics": false,
"processMetrics": false,
"promhttpMetrics": false
}
}
  • 1. Application
    • Shutdown
    • Log
  • 2. Logger
  • 3. INX
  • 4. MQTT
    • Subscriptions
    • Websocket
    • TCP
    • Auth
    • TLS
  • 5. Profiling
  • 6. Prometheus