Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

MQTT

Publishes to or subscribes from an MQTT broker (v5 by default, v3 supported).

URL format

mqtt://[user:pass@]host[:port]?topic=<topic>

mqtt:// is rewritten to tcp:// (and mqtts:// to ssl://) before being handed to the MQTT client — the scheme only selects the endpoint kind on the CLI. MQTT topic wildcards (+, #) are supported on the source side.

Examples

Subscribe to a wildcard topic and forward to Kafka, continuous:

mq-bridge-app copy \
  --from mqtt://broker.local:1883?topic=sensors/+/temperature \
  --to kafka://kafka.local:9092?topic=sensor-readings

Publish a file’s lines to a topic, one-shot:

mq-bridge-app copy --drain \
  --from file:///data/events.jsonl?format=json \
  --to mqtts://user:pass@broker.local:8883?topic=events

Fixed client ID and QoS 2 for exactly-once delivery semantics:

mq-bridge-app copy \
  --from 'mqtt://broker.local:1883?topic=alerts&client_id=mqb-alerts-01&qos=2' \
  --to null:

Key options

OptionPurpose
topicMQTT topic (wildcards on the source side).
client_idFixed client ID; auto-generated if omitted.
qosQuality of Service (0, 1, or 2). Defaults to 1.
protocolV3 or V5. Defaults to V5.
delayed_ackConsumer-only: ack after processing instead of on receipt (default).

Full field list: reference/mqtt.md.