Skip to main content
Version: 3.3.x

Config File Manual

The configuration file for BifroMQ is a YAML file located in the conf directory under standalone.yml. This file contains all the configuration parameters for BifroMQ. When starting BifroMQ, you can specify the path to the configuration file with the command-line parameter -c or --config. If the configuration file path is not specified, BifroMQ will attempt to load the standalone.yml file from the conf directory.

The complete configuration file is defined by a set of configuration objects, with the top-level object being StandaloneConfig.

StandaloneConfig

Configuration NameValue TypeDefault ValueDescription
bootstrapBooleanfalseIf the node is responsible for cluster bootstrapping, this value should be set to true. Otherwise, it should be set to false. Note: In cluster deployments, there must be exactly one bootstrap node.
authProviderFQNStringnullFully qualified class name of the custom Auth Provider implementation. If not configured, authentication and authorization will not be performed.
resourceThrottlerFQNStringnullFully qualified class name of the custom Resource Throttler implementation. If not configured, resource limiting will not be performed.
settingProviderFQNStringnullFully qualified class name of the custom Setting Provider implementation. If not configured, default initial values defined in Settings will be used.
clusterConfig.envString"Test"Cluster environment name. Cluster nodes with different environment names are isolated from each other. Cannot be null or an empty string.
clusterConfig.hostStringCommunication address of the node as a cluster node. If not configured, the actual value is determined by the following rules: If the value of mqttServerConfig.tcpListener.host is not "0.0.0.0", use that value; otherwise, if rpcServerConfig.host is configured, use that value; otherwise, use the SiteLocal address resolved from NetworkInterface.
clusterConfig.portInteger0Communication port number of the node as a cluster node. 0 means automatically selecting an unused port number. It is recommended to configure a specific port number for nodes with the bootstrap role to simplify the configuration process.
clusterConfig.seedEndpointsStringnullAddresses of seed nodes to join the cluster, in the form of ip:port addresses separated by ,. It is recommended that nodes other than the bootstrap role configure the bootstrap node address to simplify the configuration process.
clusterConfig.clusterDomainNameStringnullCluster domain name. Specifying the domain name here can further simplify the configuration process for cluster nodes when the cluster nodes are registered to a fixed domain name. BifroMQ will resolve this domain name to obtain the address of the cluster contact nodes.
mqttServerConfig.connTimeoutSecInteger20The tolerable timeout duration from establishing a TCP connection to completing the MQTT connection operation. If this limit is exceeded, the server will proactively disconnect.
mqttServerConfig.maxConnPerSecInteger2000The maximum rate of MQTT connection operations accepted per second. Connections exceeding this limit will be limited by the token bucket and subsequently disconnected.
mqttServerConfig.maxDisconnPerSecInteger1000The maximum rate of disconnecting connections per second when the node is gracefully shutting down.
mqttServerConfig.maxMsgByteSizeInteger262144This parameter is an initial setting for establishing a connection and effectively limits the size of the MQTT Connect Packet. If a Connect Packet, including the Will Message, exceeds this size, the connection will be rejected.
mqttServerConfig.maxConnBandwidthInteger524288The maximum bandwidth allowed for a single connection, calculated separately for inbound and outbound traffic.
mqttServerConfig.defaultKeepAliveSecInteger300The default keep-alive duration for connections. When clients do not actively set this, this value is used.
mqttServerConfig.bossELGThreadsInteger1The number of threads for accepting TCP connection requests.
mqttServerConfig.workerELGThreadsIntegermax(processor cores/2, 2)The number of worker threads for processing MQTT protocol signaling.
mqttServerConfig.tcpListener.enableBooleantrueWhether to enable MQTT over TCP connection method.
mqttServerConfig.tcpListener.hostString"0.0.0.0"Communication address for MQTT over TCP connection method.
mqttServerConfig.tcpListener.portInteger1883Communication port for MQTT over TCP connection method.
mqttServerConfig.tlsListener.enableBooleanfalseWhether to enable MQTT over TLS connection method.
mqttServerConfig.tlsListener.hostString"0.0.0.0"Communication address for MQTT over TLS connection method.
mqttServerConfig.tlsListener.portInteger1884Communication port for MQTT over TLS connection method.
mqttServerConfig.tlsListener.sslConfigServerSSLContextConfignullSSL configuration for MQTT over TLS connection method. Refer to the settings of the ServerSSLContextConfig object.
mqttServerConfig.wsListener.enableBooleantrueWhether to enable MQTT over WebSocket connection method.
mqttServerConfig.wsListener.hostString"0.0.0.0"Communication address for MQTT over WebSocket connection method.
mqttServerConfig.wsListener.portInteger8080Communication port for MQTT over WebSocket connection method.
mqttServerConfig.wsListener.wsPathString"/mqtt"Access path for MQTT over WebSocket connection method.
mqttServerConfig.wssListener.enableBooleanfalseWhether to enable MQTT over WebSocket Secure connection method.
mqttServerConfig.wssListener.hostString"0.0.0.0"Communication address for MQTT over WebSocket Secure connection method.
mqttServerConfig.wssListener.portInteger8443Communication port for MQTT over WebSocket Secure connection method.
mqttServerConfig.wssListener.wsPathString"/mqtt"Access path for MQTT over WebSocket Secure connection method.
mqttServerConfig.wssListener.sslConfigServerSSLContextConfignullSSL configuration for MQTT over WebSocket Secure connection method. Refer to the settings of the ServerSSLContextConfig object.
rpcClientConfig.workerThreads , baseKVClientConfig.workerThreadsIntegerprocessor coresThe number of worker threads when communicating between nodes as a client via RPC.
rpcClientConfig.enableSSL,baseKVClientConfig.enableSSLSSLContextConfigfalseEnable SSL at client side.
rpcClientConfig.sslConfig,baseKVClientConfig.sslConfigSSLContextConfignullSSL configuration when Secure RPC is enabled. Refer to the settings of the SSLContextConfig object.
rpcServerConfig.host,baseKVServerConfig.hostStringSee the rule description for ClusterConfig.host.
rpcServerConfig.port,baseKVServerConfig.portInteger0See the rule description for ClusterConfig.port.
rpcServerConfig.workerThreads,baseKVServerConfig.workerThreadsInteger2The number of worker threads when communicating between nodes as a server via RPC.
rpcServerConfig.enableSSL,baseKVServerConfig.enableSSLServerSSLContextConfigfalseEnable SSL at server side
rpcServerConfig.sslConfig,baseKVServerConfig.sslConfigServerSSLContextConfignullSSL configuration when Secure RPC is enabled. Refer to the settings of the ServerSSLContextConfig object.
stateStoreConfig.queryThreadsIntegermin(available cores/2, 2)The number of threads for the built-in state storage service to execute query type requests.
stateStoreConfig.tickerThreadsIntegermin(available cores/20, 1)The number of threads for the built-in state storage service to perform periodic tick operations.
stateStoreConfig.bgWorkerThreadsIntegermin(available cores/4, 1)The number of threads for the built-in state storage service to perform background operations.
stateStoreConfig.distWorkerConfig.queryPipelinePerStoreInteger1000The number of queryPipelines for the Dist Worker state storage service.
stateStoreConfig.distWorkerConfig.compactWALThresholdInteger2500The maximum number of logs before a compaction operation is performed in the Dist Worker state storage service.
stateStoreConfig.distWorkerConfig.dataEngineConfigStorageEngineConfigData storage engine configuration for the Dist Worker state storage service. Refer to the settings of the StorageEngineConfig object.
stateStoreConfig.distWorkerConfig.walEngineConfigStorageEngineConfigWAL storage engine configuration for the Dist Worker state storage service. Refer to the settings of the StorageEngineConfig object.
stateStoreConfig.distWorkerConfig.balanceConfigBalancerOptionsBalancer configuration for the Dist Worker state storage service. Refer to the settings of the BalancerOptions object.
inboxStoreConfig.queryPipelinePerStoreInteger100The number of queryPipelines for the Inbox Store state storage service.
inboxStoreConfig.compactWALThresholdInteger2500The maximum number of logs before a compaction operation is performed in the Inbox Store state storage service.
inboxStoreConfig.gcIntervalSecondsInteger600The interval (in seconds) for recycling expired Session data in the Inbox Store.
inboxStoreConfig.dataEngineConfigStorageEngineConfigData storage engine configuration for the Inbox Store state storage service. Refer to the settings of the StorageEngineConfig object.
inboxStoreConfig.walEngineConfigStorageEngineConfigWAL storage engine configuration for the Inbox Store state storage service. Refer to the settings of the StorageEngineConfig object.
inboxStoreConfig.balanceConfigBalancerOptionsBalancer configuration for the Inbox Store state storage service. Refer to the settings of the BalancerOptions object.
retainStoreConfig.queryPipelinePerStoreInteger100The number of queryPipelines for the Retain Store state storage service.
retainStoreConfig.compactWALThresholdInteger2500The maximum number of logs before a compaction operation is performed in the Retain Store state storage service.
retainStoreConfig.gcIntervalSecondsInteger600The interval (in seconds) for recycling expired data in the Retain Store.
retainStoreConfig.dataEngineConfigStorageEngineConfigData storage engine configuration for the Retain Store state storage service. Refer to the settings of the StorageEngineConfig object.
retainStoreConfig.walEngineConfigStorageEngineConfigWAL storage engine configuration for the Retain Store state storage service. Refer to the settings of the StorageEngineConfig object.
retainStoreConfig.balanceConfigBalancerOptionsBalancer configuration for the Retain Store state storage service. Refer to the settings of the BalancerOptions object.
apiServerConfig.enableBooleantrueWhether to enable HTTP API access.
apiServerConfig.hostStringnullAccess address for the HTTP API. If not configured, the same rule as ClusterConfig.host is used to determine the address.
apiServerConfig.httpPortInteger8091Access port for the HTTP API.
apiServerConfig.apiBossThreadsInteger1The number of threads for handling HTTP API TCP connection requests.
apiServerConfig.apiWorkerThreadsInteger2The number of worker threads for processing HTTP API requests.
apiServerConfig.httpsListenerConfig.enableBooleanfalseWhether to enable HTTPS API access.
apiServerConfig.httpsListenerConfig.hostStringnullAccess address for the HTTPS API. If not configured, the same rule as ClusterConfig.host is used to determine the address.
apiServerConfig.httpsListenerConfig.portInteger8090Access port for the HTTPS API.
apiServerConfig.httpsListenerConfig.sslConfigServerSSLContextConfignullSSL configuration for the HTTPS API. Refer to the settings of the ServerSSLContextConfig object.

SSLContextConfig && ServerSSLContextConfig

SSLContextConfig is used to configure the SSL connection parameters for the client, while ServerSSLContextConfig is used to configure the SSL connection parameters for the server.

If you leave SSLContextConfig or ServerSSLContextConfig set to null while the corresponding enable flags are set to true, a self-signed certificate will be generated, which is not recommended for production environments.

Configuration NameValue TypeDefault ValueDescription
certFileStringnullThe filename of the public certificate for the client or server.
keyFileStringnullThe filename of the private key for the client or server.
trustCertsFileStringnullThe filename of the root certificate for the client or server. If null, peer certification will not be verified, when clientAuth is OPTIONAL or REQUIRE.
clientAuthString"OPTIONAL"Only valid for ServerSSLContextConfig. Whether the server requires client verification. Possible values include:
NONE: No verification required;
OPTIONAL: Server requests client verification, but if the client does not provide a certificate, it will not fail;
REQUIRE: Server requires client verification, and if the client does not provide a certificate, it will fail.

StorageEngineConfig

StorageEngineConfig is used to set the configuration parameters for the data engine and WAL engine of the built-in state service.

Configuration NameValue TypeDescription
typeStringSpecifies the type of data engine used in the built-in storage service. Options include: rocksdb: Provides persistence functionality, allowing state to be recovered after a restart; memory: No persistence, data will be lost after a restart.
dataPathRootStringEffective when type is set to rocksdb. Specifies the directory to store data files. If configured as an absolute path, it will be directly loaded; if configured as a relative path, it will try to load from the directory specified by the DATA_DIR and user.dir system parameters.
compactMinTombstoneKeysIntegerEffective when type is set to rocksdb. The number of Tombstone keys that trigger a compaction operation.
compactTombstonePercentDoubleEffective when type is set to rocksdb. When the number of deleted keys in a specific Range exceeds compactMinTombstoneKeys, and the proportion of deleted keys to the total exceeds compactTombstonePercent, a compaction operation will be performed on this range.
asyncWALFlushBooleanApplicable only to the WAL engine, whether to enable asynchronous FlushWAL data to disk.
fsyncWALBooleanApplicable only to the WAL engine. Whether to perform an fsync operation after writing to the WAL. If this flag is true, writing speed will be slower. If this flag is false, and the machine crashes, some recent writes may be lost.

BalancerOptions

BalancerOptions is used to set the configuration parameters for the Balancer of the built-in state service.

Configuration NameValue TypeDefault ValueDescription
scheduleIntervalInMsLong5000The interval at which the Balancer attempts to balance the load.
balancersList of StringThe fully qualified names of the balancer implementations that are enabled. Different balancer implementations can be set for different built-in storage services.

Note: Adjusting the parameters related to StorageEngineConfig and BalancerOptions requires an in-depth understanding of the storage engine implementation of BifroMQ. Improper configuration may lead to abnormal behavior of the state storage service.