Dynamic Configuration
Beyond topic-level config (Topic Configuration), RobustMQ has cluster dynamic config entries stored in the Meta Service and exposed through the admin HTTP API. Runtime application and restoration after a Broker restart depend on the config_type; persistence in Meta alone does not mean every value is reloaded into every Broker runtime component. These entries do not live in config/server.toml (that is static config).
How it works
- Write a config blob through the admin HTTP API, specifying a
config_type(KafkaDynamicfor Kafka cluster switches). - The config blob is persisted in Meta Service storage.
- The update is applied to the Broker's in-memory
NodeCacheManagerconfiguration and propagated to other Brokers through cache updates. - On Broker startup,
build_cluster_config()reloadsMqttProtocol,MqttSlowSubscribeConfig,MqttFlappingDetect,MqttOfflineMessage,MqttSchema,MqttSystemMonitor, andKafkaDynamicfrom Meta. The accepted typesMqttLimit,ClusterLimit, andMetaRuntimeare not currently loaded by this Broker startup path, so their persisted values are not restored into the Broker'sNodeCacheManagerconfiguration after restart. Runtime effects for these types also depend on whether the consuming subsystem reads updated configuration dynamically.
Example: auto.create.topics.enable
This is currently the most representative Kafka cluster dynamic config item: whether to auto-create a topic when a client requests one that does not exist.
| Item | Value |
|---|---|
| Default | true (matches Kafka's broker default) |
| Hot-changeable | Yes |
| Persistence and Broker restart | Stored in Meta and reloaded by the Broker at startup |
Decision logic
Auto-creation happens only when both conditions hold:
client request carries allow_auto_topic_creation = true
AND
cluster switch auto.create.topics.enable = trueThat is: the client (e.g. a Metadata request) explicitly allows auto-creation, and the cluster switch is on. If either is false, no topic is auto-created.
Set via admin HTTP
curl -X POST http://<admin-host>:<http_port>/api/cluster/config/set \
-H 'Content-Type: application/json' \
-d '{
"config_type": "KafkaDynamic",
"config": "{\"auto_create_topics_enable\": false}"
}'config_typeis fixed toKafkaDynamic.configis a JSON string (mind the escaping); the field isauto_create_topics_enable.
Once overridden, the default no longer applies
true is the fallback default used when the value has never been set explicitly. Once you set a value through the API (whether true or false), it is persisted and the built-in default logic no longer participates — only the persisted value counts from then on, until you change it again.
Difference from other config
| Aspect | Broker static config | Cluster dynamic config | Topic config |
|---|---|---|---|
| Scope | Single node process | Whole cluster | A single topic |
| Storage | config/server.toml | Meta layer | Meta layer |
| Runtime effect | Static config is read at startup | Depends on config_type and its runtime consumers | Yes |
| Entry point | File | admin HTTP | Kafka protocol |
Related: Broker Configuration · Topic Configuration.
