Skip to main content
Version: 4.0.0-incubating

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
authProviderFQNStringnullFully qualified class name of the custom Auth Provider implementation. If not configured, authentication and authorization will not be performed.
clientBalancerFQNStringnullFully qualified class name of the custom Client Balancer implementation. If not configured, no active redirection happens.
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.
bgTaskThreadsIntegermax(available processor cores/4, 1)Threads reserved for the starter's background task executor.
clusterConfig.*ObjectSee ClusterConfigCluster join and addressing options.
rpcConfig.*ObjectSee RPCConfigRPC client/server options.
mqttServiceConfig.*ObjectSee MQTTServiceConfigMQTT service settings.
distServiceConfig.*ObjectSee DistServiceConfigDist service settings.
inboxServiceConfig.*ObjectSee InboxServiceConfigInbox service settings.
retainServiceConfig.*ObjectSee RetainServiceConfigRetain service settings.
sessionDictServiceConfig.*ObjectSee SessionDictServiceConfigSession dictionary service settings.
apiServerConfig.*ObjectSee APIServerConfigAPI server settings.

ClusterConfig (clusterConfig.*)

Configuration NameValue TypeDefault ValueDescription
clusterConfig.envString""Cluster environment name. Cluster nodes with different environment names are isolated from each other. Cannot be null or empty.
clusterConfig.hostStringnullCommunication address of the node as a cluster node. Resolution order: if mqttServiceConfig.server.tcpListener.host is not "0.0.0.0", use it; else if rpcConfig.host is set, use it; else use the SiteLocal address of the host.
clusterConfig.portInteger0Communication port number of the node as a cluster node. 0 selects a free port. For bootstrap nodes, configure a fixed port.
clusterConfig.seedEndpointsStringnullSeed node addresses to join the cluster, formatted as ip:port and separated by commas. Non-bootstrap nodes should point to a bootstrap node.
clusterConfig.clusterDomainNameStringnullCluster domain name. If set, BifroMQ resolves the domain to find cluster contact nodes, simplifying fixed-domain deployments.

RPCConfig (rpcConfig.*)

Configuration NameValue TypeDefault ValueDescription
rpcConfig.hostStringnullHost used for intra-cluster RPC. If null, follows the same host resolution rule as clusterConfig.
rpcConfig.portInteger0RPC server port. 0 lets the system pick a free port.
rpcConfig.enableSSLBooleanfalseWhether to enable TLS for RPC.
rpcConfig.clientEventLoopThreadsIntegermax(4, available processor cores/8)Netty client event-loop threads for RPC clients.
rpcConfig.serverEventLoopThreadsIntegermax(4, available processor cores/8)Netty server event-loop threads for RPC servers.
rpcConfig.clientSSLConfigSee SSLContextConfignullTLS settings for RPC clients (used when enableSSL is true).
rpcConfig.serverSSLConfigSee ServerSSLContextConfignullTLS settings for RPC servers (used when enableSSL is true).

MQTTServiceConfig (mqttServiceConfig.*)

Configuration NameValue TypeDefault ValueDescription
mqttServiceConfig.client.workerThreadsInteger0Worker threads for MQTT internal clients (0 = use caller thread).
mqttServiceConfig.server.enableBooleantrueWhether to enable the MQTT server.
mqttServiceConfig.server.connTimeoutSecInteger20Timeout from TCP connect to MQTT CONNECT completion; exceeded connections are closed.
mqttServiceConfig.server.maxConnPerSecInteger2000Max MQTT connect operations per second; excess connections are throttled/disconnected.
mqttServiceConfig.server.maxDisconnPerSecInteger1000Max disconnect operations per second during graceful shutdown.
mqttServiceConfig.server.maxMsgByteSizeInteger262144Max MQTT CONNECT packet size (including Will); larger packets are rejected.
mqttServiceConfig.server.maxConnBandwidthInteger524288Max per-connection bandwidth (inbound/outbound), in bytes per second.
mqttServiceConfig.server.bossELGThreadsInteger1Netty boss threads for accepting MQTT TCP connections.
mqttServiceConfig.server.workerELGThreadsIntegermax(available processor cores/2, 2)Netty worker threads for MQTT protocol processing.
mqttServiceConfig.server.userPropsCustomizerFactoryConfigMap<String, Struct>Customizer factory settings for MQTT 5 user properties.
mqttServiceConfig.server.tcpListener.enableBooleantrueEnable MQTT over TCP.
mqttServiceConfig.server.tcpListener.hostString"0.0.0.0"Listen address for MQTT over TCP.
mqttServiceConfig.server.tcpListener.portInteger1883Listen port for MQTT over TCP.
mqttServiceConfig.server.tlsListener.enableBooleanfalseEnable MQTT over TLS.
mqttServiceConfig.server.tlsListener.hostStringnullListen address for MQTT over TLS (defaults to resolved host when null).
mqttServiceConfig.server.tlsListener.portInteger1884Listen port for MQTT over TLS.
mqttServiceConfig.server.tlsListener.sslConfigSee ServerSSLContextConfignullTLS settings for MQTT over TLS.
mqttServiceConfig.server.wsListener.enableBooleantrueEnable MQTT over WebSocket.
mqttServiceConfig.server.wsListener.hostStringnullListen address for MQTT over WebSocket (defaults to resolved host when null).
mqttServiceConfig.server.wsListener.portInteger8080Listen port for MQTT over WebSocket.
mqttServiceConfig.server.wsListener.wsPathString"/mqtt"WebSocket path for MQTT over WebSocket.
mqttServiceConfig.server.wssListener.enableBooleanfalseEnable MQTT over WebSocket Secure.
mqttServiceConfig.server.wssListener.hostStringnullListen address for MQTT over WebSocket Secure (defaults to resolved host when null).
mqttServiceConfig.server.wssListener.portInteger8443Listen port for MQTT over WebSocket Secure.
mqttServiceConfig.server.wssListener.wsPathString"/mqtt"WebSocket path for MQTT over WebSocket Secure.
mqttServiceConfig.server.wssListener.sslConfigSee ServerSSLContextConfignullTLS settings for MQTT over WebSocket Secure.

DistServiceConfig (distServiceConfig.*)

Configuration NameValue TypeDefault ValueDescription
distServiceConfig.client.workerThreadsInteger0Worker threads for Dist client.
distServiceConfig.server.enableBooleantrueWhether to enable Dist server.
distServiceConfig.server.workerThreadsIntegermax(2, available processor cores/4)Dist server worker threads (0 = run on caller thread).
distServiceConfig.server.attributesMap<String,String>Custom attributes attached to Dist server nodes.
distServiceConfig.server.defaultGroupsSet<String>[]Default groups served by this Dist server.
distServiceConfig.workerClient.workerThreadsIntegermax(2, available processor cores/4)Worker client threads for Dist worker communication.
distServiceConfig.workerClient.queryPipelinePerStoreInteger1000Query pipelines per Dist store.
distServiceConfig.worker.enableBooleantrueWhether to enable Dist worker.
distServiceConfig.worker.workerThreadsInteger0Dist worker threads (0 = use caller thread).
distServiceConfig.worker.tickerThreadsIntegermax(1, available processor cores/20)Background ticker threads.
distServiceConfig.worker.maxWALFetchSizeInteger10MBMax WAL fetch size in bytes.
distServiceConfig.worker.compactWALThresholdInteger256MBWAL compaction threshold in bytes.
distServiceConfig.worker.minGCIntervalSecondsInteger30Minimum GC interval in seconds.
distServiceConfig.worker.maxGCIntervalSecondsInteger86400Maximum GC interval in seconds.
distServiceConfig.worker.dataEngineConfigSee StorageEngineConfigrocksdb with default settings for data engineData store engine settings for Dist worker.
distServiceConfig.worker.walEngineConfigSee StorageEngineConfigrocksdb with default settings for wal engineWAL store engine settings for Dist worker.
distServiceConfig.worker.balanceConfigSee BalancerOptionsDefault balancers for dist workerBalancer settings for Dist worker.
distServiceConfig.worker.splitHinterConfigSee SplitHinterOptionsDefault split hinters for dist workerSplit hinter settings for Dist worker. See SplitHinterOptions.
distServiceConfig.worker.attributesMap<String,String>{}Custom attributes attached to Dist worker.

InboxServiceConfig (inboxServiceConfig.*)

Configuration NameValue TypeDefault ValueDescription
inboxServiceConfig.client.workerThreadsInteger0Worker threads for Inbox client.
inboxServiceConfig.server.enableBooleantrueWhether to enable Inbox server.
inboxServiceConfig.server.workerThreadsIntegermax(2, available processor cores/4)Inbox server worker threads.
inboxServiceConfig.server.attributesMap<String,String>Custom attributes attached to Inbox server.
inboxServiceConfig.server.defaultGroupsSet<String>[]Default groups served by this Inbox server.
inboxServiceConfig.storeClient.workerThreadsIntegermax(2, available processor cores/4)Inbox store client worker threads.
inboxServiceConfig.storeClient.queryPipelinePerStoreInteger1000Query pipelines per Inbox store.
inboxServiceConfig.store.enableBooleantrueWhether to enable Inbox store.
inboxServiceConfig.store.workerThreadsInteger0Inbox store worker threads.
inboxServiceConfig.store.tickerThreadsIntegermax(1, available processor cores/20)Inbox store ticker threads.
inboxServiceConfig.store.maxWALFetchSizeInteger-1Max WAL fetch size in bytes (-1 means no limit).
inboxServiceConfig.store.compactWALThresholdInteger256MBWAL compaction threshold in bytes.
inboxServiceConfig.store.expireRateLimitInteger1000Max expired Session cleanup rate per second.
inboxServiceConfig.store.minGCIntervalSecondsInteger30Minimum GC interval in seconds.
inboxServiceConfig.store.maxGCIntervalSecondsInteger86400Maximum GC interval in seconds.
inboxServiceConfig.store.dataEngineConfigSee StorageEngineConfigrocksdb with default settings for data engineData store engine settings for Inbox store.
inboxServiceConfig.store.walEngineConfigSee StorageEngineConfigrocksdb with default settings for wal engineWAL store engine settings for Inbox store.
inboxServiceConfig.store.balanceConfigSee BalancerOptionsDefault balancers for inbox storeBalancer settings for Inbox store.
inboxServiceConfig.store.splitHinterConfigSee SplitHinterOptionsDefault split hinter for inbox storeSplit hinter settings for Inbox store. See SplitHinterOptions.
inboxServiceConfig.store.attributesMap<String,String>{}Custom attributes attached to Inbox store.

RetainServiceConfig (retainServiceConfig.*)

Configuration NameValue TypeDefault ValueDescription
retainServiceConfig.client.workerThreadsInteger0Worker threads for Retain client.
retainServiceConfig.server.enableBooleantrueWhether to enable Retain server.
retainServiceConfig.server.workerThreadsIntegermax(2, available processor cores/4)Retain server worker threads.
retainServiceConfig.server.attributesMap<String,String>Custom attributes attached to Retain server.
retainServiceConfig.server.defaultGroupsSet<String>[]Default groups served by this Retain server.
retainServiceConfig.storeClient.workerThreadsIntegermax(2, available processor cores/4)Retain store client worker threads.
retainServiceConfig.storeClient.queryPipelinePerStoreInteger1000Query pipelines per Retain store.
retainServiceConfig.store.enableBooleantrueWhether to enable Retain store.
retainServiceConfig.store.workerThreadsInteger0Retain store worker threads.
retainServiceConfig.store.tickerThreadsIntegermax(1, available processor cores/20)Retain store ticker threads.
retainServiceConfig.store.maxWALFetchSizeInteger50MBMax WAL fetch size in bytes.
retainServiceConfig.store.compactWALThresholdInteger256MBWAL compaction threshold in bytes.
retainServiceConfig.store.gcIntervalSecondsInteger600GC interval in seconds.
retainServiceConfig.store.dataEngineConfigSee StorageEngineConfigrocksdb with default settings for data engineData store engine settings for Retain store.
retainServiceConfig.store.walEngineConfigSee StorageEngineConfigrocksdb with default settings for wal engineWAL store engine settings for Retain store.
retainServiceConfig.store.balanceConfigSee BalancerOptionsDefault balancers for retain storeBalancer settings for Retain store.
retainServiceConfig.store.splitHinterConfigSee SplitHinterOptionsDefault split hinter for retain storeSplit hinter settings for Retain store. See SplitHinterOptions.
retainServiceConfig.store.attributesMap<String,String>{}Custom attributes attached to Retain store.

SessionDictServiceConfig (sessionDictServiceConfig.*)

Configuration NameValue TypeDefault ValueDescription
sessionDictServiceConfig.client.workerThreadsInteger0Worker threads for SessionDict client.
sessionDictServiceConfig.server.enableBooleantrueWhether to enable SessionDict server.
sessionDictServiceConfig.server.workerThreadsInteger0SessionDict server worker threads (0 = use caller thread).
sessionDictServiceConfig.server.attributesMap<String,String>{}Custom attributes attached to SessionDict server.
sessionDictServiceConfig.server.defaultGroupsSet<String>[]Default groups served by this SessionDict server.

APIServerConfig (apiServerConfig.*)

Configuration NameValue TypeDefault ValueDescription
apiServerConfig.enableBooleantrueWhether to enable HTTP API access.
apiServerConfig.hostStringnullAPI listen address; if null, follows the same host resolution rule.
apiServerConfig.httpPortInteger8091HTTP API port.
apiServerConfig.maxContentLengthInteger262144Max request body size in bytes.
apiServerConfig.workerThreadsInteger2Worker threads handling HTTP API requests.
apiServerConfig.enableSSLBooleanfalseWhether to enable HTTPS for the API.
apiServerConfig.sslConfigSee ServerSSLContextConfignullTLS settings for the API server when HTTPS is enabled.

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 stateful service. The shape of props depends on the engine type; defaults are applied per service in code.

Configuration NameValue TypeDefault ValueDescription
typeStringrocksdbStorage engine type. rocksdb enables persistence; memory keeps state in memory only (lost on restart).
props (rocksdb)Map<String, Object>Service-specific defaultsAdditional selectively exposed RocksDB options. Tune only if you understand RocksDB well.
props (memory)Map<String, Object>{}No options for memory currently, normally for testing purpose

BalancerOptions

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

Configuration NameValue TypeDefault ValueDescription
bootstrapDelayInMSLong15000Delay before the balancer starts; helps avoid rebalancing during initial bootstrap.
zombieProbeDelayInMSLong15000Interval for probing zombie (stale) replicas.
retryDelayInMSLong5000Delay between rebalance retries.
balancersMap<String, Struct>Service-specific defaults (see code)Map of balancer implementation FQNs to their config. Multiple balancers can be enabled; defaults are set in each service (Dist/Inbox/Retain) per code.

SplitHinterOptions

SplitHinterOptions configures how ranges are split for built-in stateful services.

Configuration NameValue TypeDefault ValueDescription
hintersMap<String, Struct>Service-specific defaults (see code)A map of split hinter implementation FQNs to their config. Multiple hinters can be enabled.

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