Skip to main content
Version: 1.0.0 (development)

Broker configuration reference

Broker startup reads a typed configuration, normalizes ownership between sections, validates it, and then constructs the runtime. This page describes canonical TOML names and the supported online update surface. For a runnable local cluster, use local source setup; for replica settings, use high availability.

File selection and precedence​

  1. -c / --configFile selects a file. Without it, the command uses $ROCKETMQ_HOME/conf/broker.toml if that file exists; otherwise it uses defaults. Set ROCKETMQ_HOME explicitly for a reproducible installation.
  2. --config-format toml|properties selects the input format. Without this option, .toml selects canonical TOML, while .conf and .properties select the Java properties converter. An ambiguous extension needs an explicit format.
  3. For the NameServer address, explicit -n / --namesrvAddr takes precedence over NAMESRV_ADDR, the file, and the default 127.0.0.1:9876. An empty but present NAMESRV_ADDR takes the override path and resolves to that default; unset it to retain the file value.
  4. Configuration validation precedes service startup. -p / --printConfigItem and -m / --printImportantConfig print the resolved configuration and exit without starting listeners.

The printed property map uses flat administrative names. It is an inspection view, not a canonical TOML file to copy back unchanged. Java properties conversion happens in memory and writes a conversion report; review that report for rejected or translated fields. --conversion-report selects the report path, otherwise the input extension is replaced by .conversion.json. Failure to write the report fails loading.

For example, from the repository root after building the Broker:

$env:ROCKETMQ_HOME = (Get-Location).Path
& .\target\debug\rocketmq-broker-rust.exe -c .\rocketmq-website\examples\first-message\broker.toml -p

Canonical section layout​

[broker]
namesrvAddr = "127.0.0.1:9876"
brokerIp1 = "127.0.0.1"
listenPort = 10911
storePathRootDir = ".rocketmq-reference/broker"
autoCreateTopicEnable = false
autoCreateSubscriptionGroup = false

[broker.brokerIdentity]
brokerClusterName = "DocsCluster"
brokerName = "docs-reference-broker"
brokerId = 0

[broker.topicQueueConfig]
defaultTopicQueueNums = 4

[store]
storePathRootDir = ".rocketmq-reference/store"
brokerRole = "ASYNC_MASTER"
flushDiskType = "ASYNC_FLUSH"
mappedFileSizeCommitLog = 1073741824
mappedFileSizeConsumeQueue = 6000000
fileReservedTime = 72
deleteWhen = "04"

This is a local configuration example, not an HA topology. Relative paths resolve against the process working directory. broker.storePathRootDir owns Broker metadata; store.storePathRootDir owns message storage. They are distinct settings even when both default to the user's home directory plus store. Preserve both when backing up or restoring.

The root accepts broker, store, logging, legacy logFilter, and observability. Root, Broker, and store schemas reject unknown fields. A Java-style brokerName at the TOML root is therefore invalid. Configure the primary listener through broker.listenPort: broker.brokerServerConfig.listenPort is derived and cannot be supplied. Likewise, store.enableControllerMode and store.duplicationEnable are derived from their Broker counterparts and are rejected as independent input.

Broker identity, routing, and admission​

All paths in this table are relative to the TOML root. Defaults describe startup configuration before explicit overrides. Unless the online-update section says otherwise, apply changes through a controlled restart.

External keyType / defaultMeaning and constraints
broker.brokerIdentity.brokerClusterNamestring / DefaultClusterNonblank cluster name; shared by intended cluster members.
broker.brokerIdentity.brokerNamestring / HOSTNAME, then COMPUTERNAME, then DEFAULT_BROKERNonblank Broker group name. Replicas share a name; independent masters use different names.
broker.brokerIdentity.brokerIdu64 / 0Outside Controller mode, a master requires 0 and a slave requires a nonzero ID. Controller authority follows its own assignment and epoch rules.
broker.namesrvAddroptional string / normally 127.0.0.1:9876Semicolon-separated valid endpoints; subject to CLI and environment precedence above.
broker.brokerIp1string / detected local address, with loopback fallbackAdvertised address for clients; choose one reachable from the client network. It is separate from the bind address.
broker.listenPortu32 / 10911Valid TCP port with a valid fast port at listenPort - 2; effective range 3..=65535.
broker.storePathRootDirstring / home + storeNonblank metadata root. Changing it does not migrate existing metadata.
broker.autoCreateTopicEnablebool / trueEnables automatic topic creation; explicit topic provisioning is easier to control in shared environments.
broker.autoCreateSubscriptionGroupbool / trueEnables automatic subscription-group creation.
broker.brokerPermissionu32 / 6Read/write permission bits; online updates require at least one read/write bit.
broker.topicQueueConfig.defaultTopicQueueNumsu32 / 8Default queue count used by topic creation; does not repartition existing topics automatically.
broker.enablePropertyFilterbool / falseEnables the Broker side of SQL/property filtering; a client selector alone is insufficient.
broker.flushConsumerOffsetIntervalu64 / 5000 msConsumer-offset persistence interval; distinct from the client's offset submission interval.
broker.registerNameServerPeriodu64 / 30000 msRegistration period. Registration visibility can differ between NameServers.
broker.registerBrokerTimeoutMillsi32 / 24000 msBroker registration request timeout. Preserve the external spelling Mills.
broker.brokerFastFailurePendingMaxCountusize / 4096Positive bound on pending request count.
broker.brokerFastFailurePendingMaxBytesusize / 67108864 bytesPositive bound on pending request bytes; a separate limit from individual message size.
broker.enableControllerModebool / falseEnables Controller-based authority; requires a valid, nonblank broker.controllerAddr.
broker.controllerAddrstring / emptyController endpoints. Use the Controller deployment's remoting addresses, not Raft addresses.

Compatibility fields are not performance promises. For example, asyncSendEnable is retained for Java configuration compatibility, and sendRequestExecutorDetachedEnable is ignored with a startup warning. Do not size Rust execution capacity from Java thread-pool settings copied into the file.

Store, disk, and replication​

External key under storeType / defaultUnit and operational meaning
storeTypeenum / LocalFileBackend selection; optional backends require the matching build features. Changing this selector is not data migration.
storePathRootDirstring / home + storeNonblank message-store root.
storePathCommitLogoptional string / unsetDefaults to the CommitLog location under the store root. Custom paths must be included in backup and recovery.
mappedFileSizeCommitLogusize / 1073741824Bytes per CommitLog segment; positive. Treat changes on an existing store as a storage-layout operation.
mappedFileSizeConsumeQueueusize / 6000000Bytes per ConsumeQueue file: 300000 × 20, not 30 MB. Must be positive.
maxMessageSizei32 / 4194304Message-size limit in bytes. Client and Broker limits must agree; batching and protocol overhead need their own allowance.
flushDiskTypeenum / ASYNC_FLUSHASYNC_FLUSH or SYNC_FLUSH. Local flush policy does not establish remote replication or business completion.
flushIntervalCommitLogi32 / 500Milliseconds between periodic CommitLog flush attempts.
flushCommitLogLeastPagesi32 / 4Flush threshold in pages. Async mode rejects a zero threshold.
syncFlushTimeoutu64 / 5000Milliseconds to wait for the synchronous flush condition. A timeout is an uncertain send outcome, not proof the message is absent.
fileReservedTimeusize / 72Retention age in hours. Disk pressure and cleanup policy also affect deletion.
deleteWhenstring / "04"Scheduled cleanup hour expression. Quote it in TOML.
diskMaxUsedSpaceRatiousize / 75Percentage threshold; must be less than the force-clean threshold.
diskSpaceCleanForciblyRatiousize / 85Percentage threshold; must be less than the warning threshold.
diskSpaceWarningLevelRatiousize / 90Disk warning threshold in percent. Runtime normalization also clamps disk ratios to supported bounds.
cleanFileForciblyEnablebool / trueAllows force-clean behavior; retention hours alone are not a guaranteed minimum retention period.
messageIndexEnablebool / trueEnables message indexing. A runtime change does not promise a historical index rebuild.
brokerRoleenum / ASYNC_MASTERASYNC_MASTER, SYNC_MASTER, or SLAVE; combine with Broker identity and the intended HA mode.
haListenAddressIP address / 0.0.0.0HA bind address.
haListenPortusize / 10912Valid nonzero TCP port, distinct from the primary and fast remoting ports.
totalReplicasusize / 1Expected replica count.
inSyncReplicasi32 / 1In-sync replica setting.
minInSyncReplicasusize / 1Minimum in-sync replicas; validation requires 1 <= min <= inSync <= total.
slaveTimeoutusize / 3000Milliseconds; positive when synchronous replication or a stronger replica requirement uses it.
haMaxTimeSlaveNotCatchupusize / 15000Milliseconds; positive in Controller mode or automatic ISR management.

The default replica counts do not create a replicated service. Use a complete HA configuration, separate store roots, reachable HA addresses, and the documented authority model. DLedger configuration is rejected, including the compatibility spellings enableDledgerCommitLog and enableDlegerCommitLog; it cannot enable Controller HA indirectly.

Online updates and persistence​

The ordinary Broker configuration transaction accepts exactly these six flat property names:

Administrative propertyAccepted runtime valueCanonical TOML path
autoCreateTopicEnabletrue or falsebroker.autoCreateTopicEnable
autoCreateSubscriptionGrouptrue or falsebroker.autoCreateSubscriptionGroup
brokerPermissionCanonical integer 2..=7 with read/write permissionbroker.brokerPermission
defaultTopicQueueNumsCanonical integer 1..=128broker.topicQueueConfig.defaultTopicQueueNums
messageIndexEnabletrue or falsestore.messageIndexEnable
traceTopicEnabletrue or falsebroker.traceTopicEnable

Boolean spellings are lowercase; noncanonical integers such as 08 are rejected. The transaction validates the candidate configuration and removes unchanged values. Index updates also require a message-store runtime projection; without it, the request fails instead of silently changing a flag.

A successful response reports applied=true and persisted=false. Update the managed startup file separately to retain the setting after restart. Topic reconciliation after a runtime update does not persist the Broker configuration file. Known fields outside this surface require restart; unknown fields are unsupported. The CAS request additionally checks a positive expectedGeneration and returns the current generation on conflict. That generation identifies a runtime configuration snapshot, not a storage epoch.

Log-filter updates use a separate authorization-aware path, not this six-field transaction. Startup logging precedence is CLI, environment input, logging.filter, legacy logFilter, then fallback. Runtime filter changes require the enabled reload path and its authentication/authorization conditions. See security and observability configuration for security materials and telemetry settings.

Inspect before changing behavior​

Print and review a candidate file before starting it. Compare advertised addresses, metadata/store roots, listener and HA ports, role/ID, and replica requirements as a set. For a running service, distinguish the effective runtime configuration from the file managed by deployment tooling. After a change, check the affected behavior: route registration for topic permissions, index queries for indexing, and actual send/replication results for durability settings.

The defining sources are raw schema, validation, Broker defaults, store defaults, and runtime transactions. This reference lists operationally significant fields; consult those schemas for specialized timer, compaction, and backend settings.