Configuration reference
Every orbitmq.toml key with its type, default and environment override.
OrbitMQ reads one TOML file. Unknown keys are errors, so a typo stops the broker from starting instead of being ignored.
Loading order
- The file named by
--config <path>(or-c <path>). - Otherwise the file named by the
ORBITMQ_CONFIGenvironment variable. - Otherwise
./orbitmq.tomlin the working directory, if it exists. - Otherwise built-in defaults.
Environment variables are applied on top of the file. An empty variable is ignored. Boolean variables accept 1, true, yes, on, 0, false, no and off. Keys marked "none" in the Env column can only be set in the file.
Top level
Process-wide settings. listen adds a plain TCP listener named default; more listeners are declared with [[listener]] tables.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
listen | string (host:port) | unset | ORBITMQ_LISTEN | Address of a plain TCP listener named default, bound before any [[listener]]. When unset, 0.0.0.0:1883 is used only if no [[listener]] table exists. |
cores | integer | 0 | ORBITMQ_CORES | Number of data-plane cores (event-loop threads). 0 starts one per CPU. |
log | string | "info" | ORBITMQ_LOG | Log filter in tracing env-filter syntax, for example info or info,orbitmq_core=debug. An invalid filter falls back to info. Logs are written to stderr. |
pin_threads | boolean | true | ORBITMQ_PIN_THREADS | Pin each core thread to its own CPU. Skipped under a CPU quota without a cpuset; see Containers. |
ring_capacity | integer | 4096 | ORBITMQ_RING_CAPACITY | Capacity of each core-to-core message ring. Values below 16 are raised to 16. |
connect_timeout_secs | integer (seconds) | 10 | ORBITMQ_CONNECT_TIMEOUT_SECS | Time allowed between accepting a network connection and receiving CONNECT. Values below 1 are raised to 1. |
[[listener]]
Zero or more named listeners. Each table adds one listener. The example file declares a WebSocket listener for illustration; it is not a default. When no [[listener]] table exists and listen is unset, the broker listens on 0.0.0.0:1883.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
name | string | required | none | Unique, non-empty listener name. It labels the per-listener metrics and is reported by GET /api/v1/status. default is taken when listen is set. |
bind | string (host:port) | required | none | Address to bind. |
kind | "tcp", "tls", "ws" or "wss" | "tcp" | none | Transport: plain MQTT over TCP, MQTT over TLS, MQTT over WebSocket, or MQTT over WebSocket over TLS. |
proxy_protocol | boolean | false | none | Expect a PROXY protocol v1 or v2 header before anything else, and use the client address it carries. Connections without a valid header are closed. |
trusted_proxies | array of strings (IP addresses or CIDR blocks) | [] | none | With proxy_protocol = true: the load balancers allowed to send the PROXY header. Connections from any other peer are closed before the header is read. Empty, any peer may send it and a warning is logged at start-up. Setting it without proxy_protocol = true is an error. See Behind a load balancer. |
handshake_timeout | integer (seconds) | 10 | none | Time allowed for the PROXY header, TLS handshake and WebSocket upgrade together. Values below 1 are raised to 1. |
max_connections | integer | 0 | none | Most connections open on this listener at once. 0 means unlimited. Further CONNECTs are refused with Server Busy (5.0) or Server unavailable (3.x). |
max_handshakes | integer | 10000 | none | Most connections on this listener still waiting for their CONNECT (PROXY header, TLS handshake and WebSocket upgrade included). Further connections are closed at once, without a CONNACK. 0 means unlimited. The listener created by listen uses the default; declare it as a [[listener]] to change it. |
max_connections_per_ip | integer | 0 | none | Most connections open on this listener from one client address: an IPv4 address or an IPv6 /64 (behind a PROXY header, the address it carries). Further connections are closed before their CONNECT. 0 means unlimited. |
max_accept_rate | integer (connections per second) | 0 | none | Most connections accepted on this listener per second, in bursts of up to one second's worth. Further connections are closed at once. 0 means unlimited. |
[listener.tls]
TLS settings of the listener declared just above. Required for kind = "tls" and kind = "wss", and rejected for any other kind.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
cert | path | required | none | PEM certificate chain, leaf certificate first. |
key | path | required | none | PEM private key (PKCS#8, PKCS#1 or SEC1). |
client_ca | path | unset | none | PEM CA bundle used to verify client certificates (mutual TLS). Without require_client_cert, a certificate is requested and verified when presented, but not required. |
require_client_cert | boolean | false | none | Refuse clients without a valid certificate. Needs client_ca. |
alpn | array of strings | [] | none | ALPN protocol names to advertise, for example ["mqtt"]. None by default. |
session_resumption | boolean | true | none | TLS session resumption: TLS 1.3 tickets (one per handshake, always with a fresh key exchange), the TLS 1.2 session-ID cache and, with tls12_tickets = true, TLS 1.2 tickets. Ticket keys are per listener, rotate every 6 hours and stay in memory. 0-RTT is always off. false makes every connection run a full handshake. See TLS session resumption. |
session_cache_size | integer (entries) | 16384 | none | Entries of the in-memory session-ID cache, through which TLS 1.2 clients resume (all of them while tls12_tickets = false). 0 means no cache. Has no effect when session_resumption = false. |
tls12_tickets | boolean | false | ORBITMQ_TLS_TLS12_TICKETS | Issue session tickets to TLS 1.2 clients. Off, TLS 1.2 clients resume through the session-ID cache only. On, they can resume statelessly, but TLS 1.2 resumption skips the key exchange, so anyone who obtains the ticket key while it is valid can decrypt the TLS 1.2 sessions it covered. TLS 1.3 tickets are not affected. The environment variable applies to every TLS listener. |
key_exchange | "client-preferred" or "hybrid-preferred" | "client-preferred" | ORBITMQ_TLS_KEY_EXCHANGE | Key-exchange group selection. client-preferred: X25519, P-256, P-384 and the post-quantum hybrid X25519MLKEM768 are offered and the client's order of preference decides, so a client that prefers the hybrid gets it. hybrid-preferred: X25519MLKEM768 whenever the client offers it at all (a client that did not send a hybrid key share pays one extra round trip), classical groups otherwise; this costs some handshake throughput. The environment variable applies to every TLS listener. See Key exchange. |
[listener.ws]
WebSocket settings of the listener declared just above. Optional for kind = "ws" and kind = "wss", and rejected for any other kind.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
path | string | "/mqtt" | none | HTTP request path that accepts the WebSocket upgrade (query strings are ignored). Must start with /. Other paths get 404. |
max_frame_size | integer (bytes) | 16777216 | none | Largest WebSocket frame payload accepted (default 16 MiB). A larger frame closes the connection with close code 1009. Must be non-zero. |
max_handshake_size | integer (bytes) | 8192 | none | Largest HTTP upgrade request accepted (default 8 KiB). A larger request gets 431. Must be non-zero. |
require_subprotocol | boolean | true | none | Refuse clients that offer neither the mqtt nor the mqttv3.1 subprotocol with 400. With false such clients are accepted without a subprotocol. |
[mqtt]
MQTT protocol limits. Every default is the behaviour the specification describes, so a default broker announces nothing unusual. A value that differs is announced to MQTT 5.0 clients in CONNACK where the specification defines a property for it. See the limits guide for the effect of each limit. Every key can be overridden with ORBITMQ_ plus the upper-case key name.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
max_packet_size | integer (bytes) | 268435460 | ORBITMQ_MAX_PACKET_SIZE, ORBITMQ_MAXIMUM_PACKET_SIZE | Largest packet accepted from clients, fixed header included. Also accepted as maximum_packet_size (file and ORBITMQ_MAXIMUM_PACKET_SIZE). Must be non-zero. |
max_connect_packet_size | integer (bytes) | 1048576 | ORBITMQ_MAX_CONNECT_PACKET_SIZE | Largest packet accepted before the CONNECT is accepted, which is the CONNECT itself; the lower of this and max_packet_size applies. A larger CONNECT is refused with CONNACK Packet too large (5.0) or the connection is closed (3.x). 0 means max_packet_size. |
receive_maximum | integer (1 to 65535) | 65535 | ORBITMQ_RECEIVE_MAXIMUM | How many QoS 1 and QoS 2 PUBLISH packets a client may have unacknowledged towards the broker. Must be non-zero. |
topic_alias_maximum | integer (0 to 65535) | 32 | ORBITMQ_TOPIC_ALIAS_MAXIMUM | Highest Topic Alias accepted from MQTT 5.0 clients. 0 accepts no aliases. |
maximum_qos | integer (0, 1 or 2) | 2 | ORBITMQ_MAXIMUM_QOS | Highest QoS the broker supports. |
retain_available | boolean | true | ORBITMQ_RETAIN_AVAILABLE | Whether retained messages are supported. |
wildcard_subscriptions | boolean | true | ORBITMQ_WILDCARD_SUBSCRIPTIONS | Whether subscriptions with + or # are accepted. |
subscription_identifiers | boolean | true | ORBITMQ_SUBSCRIPTION_IDENTIFIERS | Whether MQTT 5.0 Subscription Identifiers are accepted. |
shared_subscriptions | boolean | true | ORBITMQ_SHARED_SUBSCRIPTIONS | Whether shared subscriptions ($share/{group}/{filter}) are supported. |
shared_subscriptions_v3 | boolean | false | ORBITMQ_SHARED_SUBSCRIPTIONS_V3 | Also treat $share/{group}/{filter} as a shared subscription for MQTT 3.1 and 3.1.1 clients. Off by default, where it is an ordinary topic filter, as those specifications define. |
server_keep_alive | integer (seconds) | 0 | ORBITMQ_SERVER_KEEP_ALIVE | When greater than 0, the keep alive imposed on MQTT 5.0 clients instead of the one they request. 0 keeps the client value. |
max_session_expiry | integer (seconds) | 4294967295 | ORBITMQ_MAX_SESSION_EXPIRY | Upper bound for the Session Expiry Interval. The default, 4294967295, means a session may never expire. MQTT 3.x persistent sessions (clean session 0) are kept for this long. |
max_message_expiry | integer (seconds) | 0 | ORBITMQ_MAX_MESSAGE_EXPIRY | Longest lifetime of a message. Messages without a Message Expiry Interval, or with a longer one, expire after this. 0 means unlimited. |
max_inflight | integer (1 to 65535) | 65535 | ORBITMQ_MAX_INFLIGHT | Most unacknowledged QoS 1 and QoS 2 messages the broker sends to one client. The client Receive Maximum is honoured as well. Must be non-zero. |
max_queued_messages | integer | 10000 | ORBITMQ_MAX_QUEUED_MESSAGES | Messages queued per session while the in-flight window is full or the client is offline. Further QoS 1 and QoS 2 messages are dropped. |
max_queued_bytes | integer (bytes) | 16777216 | ORBITMQ_MAX_QUEUED_BYTES | Bytes queued per session. Each message is charged its topic, payload and forwarded properties plus 320 bytes. Beyond it, further QoS 1 and QoS 2 messages are dropped. 0 = unlimited. |
max_queued_memory | integer (bytes) | 0 | ORBITMQ_MAX_QUEUED_MEMORY | Node-wide memory budget: queued, in-flight and retained messages, read and outbound buffers. Split equally between the cores. Above its share, a core drops the oldest messages of its longest queues, then closes connections holding large partial packets or stuck output. 0 = derive it from max_queued_memory_percent. |
max_queued_memory_percent | integer (percent) | 25 | ORBITMQ_MAX_QUEUED_MEMORY_PERCENT | Node-wide memory budget as a percentage of the memory limit (the cgroup limit, else physical memory, else an assumed 4 GiB), used when max_queued_memory is 0. At most 100. 0 = no node-wide budget. |
max_buffered_bytes | integer (bytes) | 8388608 | ORBITMQ_MAX_BUFFERED_BYTES | Bytes buffered for one connection before QoS 0 deliveries are dropped and QoS 1 and QoS 2 deliveries wait in the session queue. |
max_client_id_len | integer | 65535 | ORBITMQ_MAX_CLIENT_ID_LEN | Longest client identifier accepted, in bytes. MQTT 3.1 clients are limited to 23 characters by their specification regardless. |
allow_empty_client_id | boolean | true | ORBITMQ_ALLOW_EMPTY_CLIENT_ID | Accept a zero-length client identifier and assign a unique one (MQTT 3.1.1 requires clean session 1 for this). |
outbound_topic_aliases | boolean | true | ORBITMQ_OUTBOUND_TOPIC_ALIASES | Assign Topic Aliases on PUBLISH packets sent to MQTT 5.0 clients that declare a Topic Alias Maximum. |
queue_qos0_offline | boolean | false | ORBITMQ_QUEUE_QOS0_OFFLINE | Queue QoS 0 messages for offline persistent sessions. |
max_connections | integer | 0 | ORBITMQ_MAX_CONNECTIONS | Most connections open on the node at once. 0 means unlimited. Further CONNECTs are refused with Server Busy (5.0, reason code 0x89) or Server unavailable (3.x, return code 3). |
max_retained_messages | integer | 0 | ORBITMQ_MAX_RETAINED_MESSAGES | Retained messages per core shard. 0 means unlimited. A new retained topic beyond the limit is not stored (a warning is logged); the message is still delivered to current subscribers. |
max_retained_bytes | integer (bytes) | 0 | ORBITMQ_MAX_RETAINED_BYTES | Bytes of retained messages per core shard. 0 means unlimited. Same behaviour as max_retained_messages when exceeded. |
[auth]
Settings of both chains: the chain ends, superusers, the authentication timeout and the state file that keeps runtime changes. Every key can be overridden with ORBITMQ_AUTH_ plus the upper-case key name; lists are comma-separated. See Authentication and Authorization.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
allow_anonymous | boolean | unset | ORBITMQ_AUTH_ALLOW_ANONYMOUS | Authentication chain end for clients without a user name that no source accepted or refused: true lets them in, false refuses them with 0x87 Not Authorized (3.x return code 5). A client that sends a user name nobody accepts is always refused with 0x86 when the chain has a source. false requires an [[authentication]] source. Unset, it is false while the chain has a source and true otherwise. true with a source that has on_error = "ignore" is fail-open. |
superusers | array of strings | [] | ORBITMQ_AUTH_SUPERUSERS | User names that become superusers once any authentication source has accepted them: authorization sources with superuser_bypass = true allow them before their rules, and ACL-file rules with who = "superuser" match them. Anonymous clients are never superusers. Requires an [[authentication]] source; empty names are rejected. The environment variable takes a comma-separated list. |
timeout_ms | integer (milliseconds) | 5000 | ORBITMQ_AUTH_TIMEOUT_MS | Time allowed for the whole authentication of one CONNECT, ACL loads included. When it runs out the client is refused with 0x88 Server Unavailable (3.x return code 3). Values below 1 are raised to 1. |
no_match | "deny", "allow" or "ignore" | "deny" | ORBITMQ_AUTH_NO_MATCH | Authorization chain end: the decision when every enabled [[authorization]] source answered ignore. ignore leaves the action to an authorizer registered after the chain, if any; without one it is refused. An empty authorization chain allows everything regardless. |
state_file | path | unset | ORBITMQ_AUTH_STATE_FILE | Where runtime changes of the chains (admin API, dashboard) are written (mode 0600). Unset, orbitmq.auth-state.toml in the directory of the configuration file is used. While it exists it replaces every [[authentication]] and [[authorization]] table at start-up; an invalid state file stops the broker. Without a configuration file and without this key, changes are kept in memory only. See The state file. |
verify_concurrency | integer | 0 | ORBITMQ_AUTH_VERIFY_CONCURRENCY | Password-hash verifications of password_file sources running at once per core. 0 picks the CPUs divided by the cores, at least 2. See Hashing limits. |
verify_queue | integer | 1024 | ORBITMQ_AUTH_VERIFY_QUEUE | Verifications waiting per core once verify_concurrency are running. Further clients are refused with 0x89 Server Busy (3.x return code 3, server unavailable). |
[[authentication]]
The authentication chain: each table adds one source, tried in file order (the order can be changed at runtime). Every table has a kind and the common keys below; the other keys belong to the kind and are described in Source kinds. Unknown keys, and keys of the other chain, are errors. These keys have no environment overrides, but secrets can be read from an environment variable or a file ({ env = "NAME" }, { file = "/path" }). While the state file exists, its chains replace these tables.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
kind | "password_file", "x509", "jwt", "http", "postgres", "mysql", "redis" or "mongodb" | required | none | Source kind. orbitmq --help lists the kinds compiled into the binary; the default build has all of them. |
name | string | the kind | none | Unique name in the chain: 1 to 64 letters, digits, -, _ or .. Used in logs, metrics and the admin API. Two sources of one kind need distinct names. |
path | path | required | ORBITMQ_AUTH_PASSWORD_FILE | kind = "password_file": the password file (username:hash lines as printed by orbitmqctl passwd), read when the source is built. The environment variable appends a password_file source named password_file at the end of the chain. |
url | string or secret | required | none | http: the endpoint (a plain string). postgres, mysql, redis and mongodb: the connection URL, a secret. The same key exists on [[authorization]] sources of these kinds; see Source kinds. |
database | string | required | none | kind = "mongodb": the database. |
collection | string | required | none | kind = "mongodb": the user collection. |
enabled | boolean | true | none | Disabled sources are skipped. Can be changed at runtime. |
timeout_ms | integer (milliseconds) | 3000 | none | Network kinds: time allowed for one check. A timeout is a backend error (on_error). Values below 1 are raised to 1. |
on_error | "deny" or "ignore" | "deny" | none | Backend errors, timeouts and max_in_flight overflow. deny refuses the client with 0x88 Server Unavailable (fail closed); ignore passes it to the next source. |
on_not_found | "ignore" or "deny" | "ignore" | none | Unknown users (not in the password file; no row, key or document; an HTTP ignore answer). ignore passes to the next source; deny refuses with 0x86 Bad User Name or Password. |
max_in_flight | integer | 256 | none | Network kinds: most checks running at once. Further clients are treated as a backend error (on_error). |
[[authorization]]
The authorization chain: each table adds one source, asked in file order for every PUBLISH and SUBSCRIBE. Same rules as [[authentication]]; the kinds are described in Authorization sources.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
kind | "file", "jwt", "http", "postgres", "mysql", "redis" or "mongodb" | required | none | Source kind. file evaluates an ACL file; the other kinds load each client's rules once, at CONNECT. |
path | path | required | ORBITMQ_AUTH_ACL_FILE | kind = "file": the ACL file (TOML), read when the source is built. The environment variable appends a file source named acl_file at the end of the chain. |
superuser_bypass | boolean | true | none | Allow superusers before this source's rules. With false the rules apply to superusers too (where who = "superuser" rules can match). |
no_match | "ignore", "deny" or "allow" | "ignore" | none | This source's decision when none of its rules matches. ignore lets the next source decide. |
name | string | the kind | none | Unique name in the chain, as for [[authentication]]. |
enabled | boolean | true | none | Disabled sources are skipped and load nothing at CONNECT. Can be changed at runtime. |
timeout_ms | integer (milliseconds) | 3000 | none | Network kinds: time allowed for one ACL load at CONNECT. A timeout is a backend error (on_error). |
on_error | "deny" or "ignore" | "deny" | none | A failed ACL load (error, timeout, max_in_flight overflow, unusable rules). deny: this source denies every action of that session (fail closed); ignore: it answers ignore for that session. |
max_in_flight | integer | 256 | none | Network kinds: most ACL loads running at once. |
[authentication.cache]
Decision cache of the network source (jwt, http, postgres, mysql, redis, mongodb) declared just above. [authorization.cache] takes the same keys. See Caching.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
ttl_secs | integer (seconds) | 60 | none | How long an accepted client, or a client's loaded rules, are remembered. A revoked user can still connect, and changed rules still apply to new sessions, for this long. Never longer than a JWT's exp or an HTTP expire_at. 0 disables positive caching. |
negative_ttl_secs | integer (seconds) | 5 | none | How long a refusal or an unknown user is remembered. 0 disables negative caching. Errors are never cached. |
max_entries | integer | 10000 | none | Most cached answers for this source; the oldest are evicted first. 0 disables the cache. |
[admin]
The admin REST API and the Prometheus /metrics endpoint, served on their own listener. The API starts only when enabled = true and at least one token is configured, or with insecure = true on a loopback address. See Admin REST API.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
enabled | boolean | true | ORBITMQ_ADMIN_ENABLED | Serve the admin API. It also needs tokens, or insecure = true on a loopback address; otherwise it stays off and an info line is logged. |
listen | string (host:port) | "127.0.0.1:18083" | ORBITMQ_ADMIN_LISTEN | Listen address of the admin API and /metrics, separate from every MQTT listener. |
tokens | array of strings | [] | ORBITMQ_ADMIN_TOKENS | Accepted bearer tokens. The environment variable takes a comma-separated list. Empty tokens are rejected. The example file uses the placeholder "change-me". |
insecure | boolean | false | ORBITMQ_ADMIN_INSECURE | Serve the API without authentication. Allowed only on a loopback address and only when no tokens are set. |
request_timeout_ms | integer (milliseconds) | 2000 | ORBITMQ_ADMIN_REQUEST_TIMEOUT_MS | How long an API query or /metrics scrape waits for every core to answer before returning 504. |
allowed_hosts | array of strings | [] | ORBITMQ_ADMIN_ALLOWED_HOSTS | Host names accepted in the Host header besides IP addresses, localhost and *.localhost (a guard against DNS rebinding). "*" accepts any host. Other requests get 421 host_not_allowed. The environment variable takes a comma-separated list. See Request guards. |
max_streams | integer | 32 | ORBITMQ_ADMIN_MAX_STREAMS | Most server-sent event streams (/api/v1/logs, /api/v1/metrics/stream) open at once; further ones get 429 too_many_streams. |
tls | table (the [listener.tls] keys) | unset | none | Serve the admin API, /metrics and the dashboard over HTTPS. Takes the keys of [listener.tls] (cert, key, optional client_ca and require_client_cert, ...); ALPN defaults to http/1.1. Unset, the listener speaks plain HTTP, and a warning is logged when listen is not a loopback address. See TLS. |
dashboard | boolean | true | ORBITMQ_ADMIN_DASHBOARD | Serve the built-in dashboard at /dashboard/ on the admin listener (/ redirects there). The page files are public; the API they call still needs a token unless insecure is set. Builds without the dashboard feature ignore it. |
[rules]
The SQL rule engine. Every key except node can be overridden with ORBITMQ_RULES_ plus the upper-case key name. See Rules and integrations.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
enabled | boolean | true | ORBITMQ_RULES_ENABLED | Run the rule engine. With false no publish tap is registered (no cost), [[rule]] tables are ignored with a warning and the rules endpoints of the admin API answer 503 unavailable. |
queue_capacity | integer (messages) | 10000 | ORBITMQ_RULES_QUEUE_CAPACITY | Capacity of each core's queue to the rule evaluation tasks. When it is full, matching messages are dropped for rules and counted (result="dropped"); publishers are never slowed. |
action_queue_capacity | integer (messages) | 10000 | ORBITMQ_RULES_ACTION_QUEUE_CAPACITY | Capacity of each rule action's queue. When it is full, the message is dropped for that action and counted. |
workers | integer | 2 | ORBITMQ_RULES_WORKERS | Threads of the rules runtime (evaluation and delivery), clamped to 1 to 64. |
node | string | local | none | Value of the node field in rule SQL. |
state_file | path | unset | ORBITMQ_RULES_STATE_FILE | Keeps the rules created through the admin API (mode 0600). Unset, orbitmq.rules-state.toml in the directory of the configuration file is used. The stored rules add to the [[rule]] tables. An invalid file stops the start-up. Without a configuration file and without this key, API changes live in memory only. See The rules state file. |
[[rule]]
SQL rules, one table each, with their actions as [[rule.action]] tables (type = republish, webhook, mqtt or kafka). Rules defined here are read-only through the admin API. The action keys are described in Actions.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
id | string | required | none | Unique id: 1 to 64 characters of A-Z a-z 0-9 - _. test is reserved. |
description | string | "" | none | Free text, at most 1024 bytes. |
sql | string | required | none | SELECT … FROM "topic/filter" [WHERE …]; see The SQL language. |
enabled | boolean | true | none | Whether the rule runs. |
[[rule.action]]
The actions of the rule above, run for every message that passes it. Each type takes its own keys; the most common are listed here, all of them in Actions.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
type | "republish", "webhook", "mqtt" or "kafka" | required | none | What the action does. Its other keys depend on the type; see Actions. |
topic | string (template) | required | none | republish, mqtt and kafka: topic to publish or produce to; ${column} inserts an output column. |
qos | integer | 0 | none | QoS of a republish (0 to 2) or mqtt (0 or 1) action. |
url | string | required | none | webhook: the https:// URL; plain http:// only for loopback hosts unless allow_http = true. |
body | string (template) | unset | none | webhook: request body template; unset, the output as JSON. |
dead_letter_topic | string | unset | none | Where a message goes once it is given up, instead of being dropped. See Dead letters. |
connector | string | required | none | mqtt and kafka: name of the [[connector]] to use. |
key | string (template) | unset | none | kafka: record key template; it picks the partition. Unset, records go round-robin. |
[[connector]]
Named connections used by mqtt and kafka rule actions. Credentials accept { env = "NAME" } and { file = "/path" }. The keys of each kind are described in Connectors.
| Key | Type | Default | Env | Description |
|---|---|---|---|---|
name | string | required | none | Unique name used by rule actions: 1 to 64 characters of A-Z a-z 0-9 - _. |
kind | "mqtt" or "kafka" | required | none | An MQTT bridge to another broker, or a Kafka producer. |
bootstrap | array of strings | required | none | Kafka only: bootstrap brokers as host:port. |
tls | table | unset | none | TLS to the remote broker or Kafka; unset, plain TCP. {} uses the bundled and system roots. See TLS. |
address | string | required | none | MQTT only: host:port of the remote broker. |
client_id | string | unset | none | Client identifier sent to the remote broker or Kafka; unset, orbitmq-bridge-<name> (MQTT) or orbitmq (Kafka). |
username | string | unset | none | MQTT only: user name on the remote broker. |
password | secret | unset | none | MQTT only: password on the remote broker; inline, { env = "NAME" } or { file = "/path" }. |
Command line
| Flag | Effect |
|---|---|
--config <path>, -c <path> | Load this file (see the loading order above). |
--version, -V | Print the version and exit. |
--help, -h | Print usage, the supported protocol levels, the listener keys, the environment variables and the authentication and authorization source kinds compiled into the binary. |
--licenses | Print the licence texts and notices of the third-party software compiled into the binary (the same text as GET /licenses.txt on the admin listener) and exit. |
An invalid file, value or listener makes orbitmq print the error and exit with status 2. SIGINT or SIGTERM stops the broker gracefully.
Example file
The broker repository ships this file as crates/orbitmq-server/orbitmq.example.toml. Every [mqtt] value in it is the default.
# SPDX-License-Identifier: BUSL-1.1
# Copyright (c) 2026 SOFTT
#
# Example orbitmq.toml with every key at its default unless noted.
# Load with `orbitmq --config orbitmq.toml` (or ORBITMQ_CONFIG=path; ./orbitmq.toml is used when present).
# Environment variables override the file (see each key).
# Plain TCP listener named "default" (env ORBITMQ_LISTEN). When unset, 0.0.0.0:1883 is used
# only if no [[listener]] table exists.
listen = "0.0.0.0:1883"
cores = 0 # data-plane cores, 0 = one per CPU (env ORBITMQ_CORES)
log = "info" # tracing env-filter (env ORBITMQ_LOG)
pin_threads = true # not under a CPU quota without a cpuset (env ORBITMQ_PIN_THREADS)
ring_capacity = 4096 # per core-to-core ring (env ORBITMQ_RING_CAPACITY)
connect_timeout_secs = 10 # TCP accept -> CONNECT (env ORBITMQ_CONNECT_TIMEOUT_SECS)
# Additional listeners (example; not a default).
[[listener]]
name = "websocket"
bind = "0.0.0.0:8083"
kind = "ws" # tcp | tls | ws | wss ([listener.tls] needed for tls/wss)
proxy_protocol = false
# trusted_proxies = ["10.0.0.0/8"] # with proxy_protocol: load balancers allowed to send the header
handshake_timeout = 10
max_connections = 0 # 0 = unlimited (per listener)
# Pre-authentication limits; refused connections are closed without a CONNACK. The "default"
# listener from `listen` uses these defaults; declare it as a [[listener]] to change them.
max_handshakes = 10000 # connections waiting for their CONNECT (TLS/WS/PROXY included), 0 = unlimited
max_connections_per_ip = 0 # per IPv4 address or IPv6 /64 (the PROXY header's address), 0 = unlimited
max_accept_rate = 0 # connections per second, bursts of one second's worth, 0 = unlimited
[listener.ws]
path = "/mqtt"
max_frame_size = 16777216 # largest WebSocket frame payload (bytes); larger frames close with 1009
max_handshake_size = 8192 # largest upgrade request (bytes)
require_subprotocol = true # refuse clients offering neither "mqtt" nor "mqttv3.1"
# MQTT limits. Defaults are the specification's; a value that differs is announced to
# MQTT 5.0 clients in CONNACK where the spec defines a property for it.
# Env: ORBITMQ_ + the upper-case key, e.g. ORBITMQ_RECEIVE_MAXIMUM, ORBITMQ_MAXIMUM_PACKET_SIZE.
[mqtt]
max_packet_size = 268435460 # alias maximum_packet_size; CONNACK Maximum Packet Size when lower
max_connect_packet_size = 1048576 # before the CONNECT is accepted (lower of the two applies); a larger
# CONNECT gets 5.0 CONNACK 0x95 or a closed connection; 0 = max_packet_size
receive_maximum = 65535 # CONNACK Receive Maximum when lower
topic_alias_maximum = 32 # CONNACK Topic Alias Maximum (0 = no aliases accepted)
maximum_qos = 2 # CONNACK Maximum QoS when 0 or 1
retain_available = true # CONNACK Retain Available = 0 when false
wildcard_subscriptions = true # CONNACK Wildcard Subscription Available = 0 when false
subscription_identifiers = true # CONNACK Subscription Identifiers Available = 0 when false
shared_subscriptions = true # CONNACK Shared Subscription Available = 0 when false
shared_subscriptions_v3 = false # honour $share/ for MQTT 3.x clients
server_keep_alive = 0 # > 0: CONNACK Server Keep Alive overrides the client's
max_session_expiry = 4294967295 # cap; a lower granted value is announced in CONNACK
max_message_expiry = 0 # seconds, 0 = unlimited; caps (and sets) message lifetime
max_inflight = 65535 # unacknowledged QoS 1/2 messages towards one client
max_queued_messages = 10000 # per session; further QoS 1/2 messages are dropped (full load: 100000)
max_queued_bytes = 16777216 # per session (topic + payload + 320 B each), 0 = unlimited (full load: 67108864)
max_queued_memory = 0 # node-wide memory budget in bytes, 0 = use the percentage; counts
# queued, in-flight and retained messages, read and outbound buffers
max_queued_memory_percent = 25 # of the memory limit (cgroup, else RAM; 4 GiB if unknown); 0 = no budget;
# above it the longest queues drop their oldest messages, then large
# partial packets and stuck connections are closed
max_buffered_bytes = 8388608 # per connection before QoS 0 is dropped
max_client_id_len = 65535
allow_empty_client_id = true
outbound_topic_aliases = true
queue_qos0_offline = false
max_connections = 0 # node-wide, 0 = unlimited (refused with 0x89 / return code 3)
max_retained_messages = 0 # per core shard, 0 = unlimited
max_retained_bytes = 0 # per core shard, 0 = unlimited
# Env: ORBITMQ_AUTH_ + the upper-case key; lists are comma-separated.
[auth]
# Chain end for clients without a user name. Unset: true while the authentication chain has no
# source, false as soon as it has one. Together with on_error = "ignore" on a source, true is
# fail-open: during an outage of that source, clients without a user name connect anonymously.
# allow_anonymous = false
superusers = [] # users made superusers by whichever source authenticated them
timeout_ms = 5000 # whole authentication of one CONNECT, ACL loads included
no_match = "deny" # authorization chain end: deny | allow | ignore
# state_file = "/var/lib/orbitmq/orbitmq.auth-state.toml" # default: next to this file
verify_concurrency = 0 # password-file hash checks running per core (0 = auto: CPUs / cores, at least 2)
verify_queue = 1024 # waiting per core; beyond it clients are refused with Server Busy
# Authentication chain: sources are tried in this order; the first allow or deny
# wins, `ignore` (no user name, unknown user, ...) passes to the next. Reorder, enable and
# edit them at runtime from the dashboard or /api/v1/auth/authentication (kept in state_file).
# [[authentication]]
# kind = "password_file" # password_file | x509 | jwt | http | postgres | mysql | redis | mongodb
# name = "local"
# path = "/etc/orbitmq/passwords" # lines from `orbitmqctl passwd`
#
# [[authentication]]
# kind = "mongodb"
# url = { env = "MONGO_URL" }
# database = "mqtt"
# collection = "users"
# Authorization chain: asked in this order for every PUBLISH and SUBSCRIBE, independent of
# the source that authenticated the client. Database sources load the client's rules once,
# at CONNECT.
# [[authorization]]
# kind = "file" # file | jwt | http | postgres | mysql | redis | mongodb
# path = "/etc/orbitmq/acl.toml"
# superuser_bypass = true
# no_match = "ignore" # when none of this source's rules matches
# Management REST API (/api/v1/...) and Prometheus /metrics, on a separate listener.
# It starts only with at least one token, or with insecure = true on a loopback address.
[admin]
enabled = true # env ORBITMQ_ADMIN_ENABLED
listen = "127.0.0.1:18083" # env ORBITMQ_ADMIN_LISTEN
tokens = ["change-me"] # env ORBITMQ_ADMIN_TOKENS (comma-separated); example value
insecure = false # env ORBITMQ_ADMIN_INSECURE
request_timeout_ms = 2000 # how long a query waits for every core (env ORBITMQ_ADMIN_REQUEST_TIMEOUT_MS)
allowed_hosts = [] # Host names besides IP addresses and localhost (DNS rebinding guard); "*" = any
max_streams = 32 # log and metrics event streams open at once
# tls = { cert = "/etc/orbitmq/admin.pem", key = "/etc/orbitmq/admin.key" } # HTTPS (the [listener.tls] keys)
# SQL rule engine: rules run over published messages and hand each result to
# actions (republish, webhook, MQTT bridge, Kafka). Rules can also be created at runtime from
# the dashboard or /api/v1/rules (kept in state_file). Env: ORBITMQ_RULES_ + the upper-case key
# (all but node).
[rules]
enabled = true # false: no tap, no cost; [[rule]] tables are ignored
queue_capacity = 10000 # per core, messages waiting for evaluation
action_queue_capacity = 10000 # per action
workers = 2 # threads of the rules runtime
# node = "local" # value of the `node` field in rules
# state_file = "/var/lib/orbitmq/orbitmq.rules-state.toml" # default: next to this file
# A rule: SELECT <columns> FROM "<topic filter>"[, ...] [WHERE <condition>], and its actions.
# Templates insert output columns with ${column} or ${column.path}.
# [[rule]]
# id = "hot"
# description = "temperatures above 30"
# sql = '''
# SELECT payload.temp AS t, clientid, topic_level(2) AS site
# FROM "sensors/+/temp"
# WHERE float(payload.temp) > 30
# '''
#
# [[rule.action]]
# type = "republish" # republish | webhook | mqtt | kafka
# topic = "alerts/${site}"
# qos = 1
#
# [[rule.action]]
# type = "webhook"
# url = "https://hooks.example.com/orbitmq"
# body = '{"device":"${clientid}","temp":${t}}'
# dead_letter_topic = "rules/dead/hot"
#
# [[rule.action]]
# type = "kafka"
# connector = "events"
# topic = "hot-sensors"
# key = "${clientid}"
#
# [[rule.action]]
# type = "mqtt"
# connector = "cloud"
# topic = "edge-1/alerts/${site}"
# qos = 1
# Connectors used by mqtt and kafka actions; changed only in this file (restart to apply).
# [[connector]]
# name = "events"
# kind = "kafka"
# bootstrap = ["kafka-1:9093", "kafka-2:9093"]
# tls = { ca_file = "/etc/orbitmq/kafka-ca.pem" }
# sasl = { mechanism = "scram-sha-512", username = "orbitmq", password = { env = "KAFKA_PASSWORD" } }
#
# [[connector]]
# name = "cloud"
# kind = "mqtt"
# address = "mqtt.example.com:8883"
# tls = {}
# client_id = "edge-1"
# username = "edge"
# password = { file = "/run/secrets/cloud" }