Skip to content
MaestroHub
Menu
Free trialdownload and run it todayStart the pilot

Integrations

MQTT to Kafka, without a script.

Subscribe to the plant's MQTT topics with MaestroHub, check each message against its schema and quality, and produce it to Kafka topics with a key such as the machine id. Messages wait on disk if the Kafka cluster is unreachable and are delivered in order.

The flow

One value, from the machine to Kafka. Illustrative.

MQTTmessage brokerplant/line2/+/+
MaestroHub

Filler 2 speed · 412 bpm · Good

  • named, unit, quality
  • origin stamped
  • buffered on disk
Kafkaevent streamingplant.telemetry (key: line2/filler2)

Why do it with MaestroHub

More than a pipe from MQTT to Kafka.

01

Schema-checked before Kafka

Messages that don't match their schema are stopped or flagged before they reach downstream consumers.

02

Order kept where it matters

Kafka is an ordered destination, so buffered messages are delivered in order after an outage.

03

Keys from the plant model

Partition keys come from the asset structure, so each machine's events stay together.

What lands in Kafka

An example. You choose the fields in the pipeline.

keysignalvalueunitqualityts
line2/filler2speed412bpmgood2026-10-03T06:00:01Z

Set it up in three steps

  1. 1

    Connect MQTT

    Add the broker and subscribe to the topics you need; the Discover tab shows what the broker already carries.

  2. 2

    Give the values meaning

    Map each value to a topic in the namespace with its name, unit and schema. Quality and origin are stamped on every value.

  3. 3

    Deliver to Kafka

    Add a Kafka produce output, choose the topic and the message key, for example the machine id.

Before you start

What each side needs, from the connector documentation.

MQTT

  • A reachable MQTT broker: hostname, port (typically 1883 plain, 8883 for TLS) and protocol tcp, ssl, ws or wss.
  • Broker credentials if the broker requires them. A password needs a username.
  • For verified TLS or mutual TLS: the CA certificate, client certificate and private key in PEM format.

Example settings

Protocol
ssl
Broker Hostname
broker.example.com
Port
8883
MQTT Version
3.1.1
Client ID
<your-client-id>
Keep Alive (sec)
60
MQTT connector documentation

Kafka

  • Bootstrap broker addresses as host:port, comma separated. Default ports are 9092 for PLAINTEXT, 9093 for SSL/TLS and 9094 for SASL_PLAINTEXT; use the port of your broker's listener.
  • SASL credentials if the cluster requires them, using PLAIN, SCRAM-SHA-256 or SCRAM-SHA-512.
  • A consumer group ID for consume functions, set on the connection or overridden per function.

Example settings

Brokers
broker1:9092,broker2:9092
Client ID
maestrohub-producer
Consumer Group ID
maestrohub-consumers
Enable SASL
true
SASL Mechanism
SCRAM-SHA-256
Enable TLS
true
Kafka connector documentation

Things to know

Pitfalls and limits the documentation calls out, so they don't surprise you on site.

MQTT

  • Plain ws cannot use TLS. Use wss for TLS over WebSocket.
  • The certificate fields appear only when TLS is on and certificate verification is not skipped.
  • On MQTT 5.0, write a shared subscription in the topic filter to load-balance across clients: $share/<group>/<topic>.

Limits

  • Reconnection, subscription recovery and message acknowledgement are handled by the platform and cannot be configured on the connection.

Kafka

  • Keep Auto Commit off. Offsets are then committed after the pipeline succeeds, which gives at-least-once delivery. With it on, a message can be lost if processing fails.
  • Set Session Timeout to at least 3 times the Heartbeat Interval, or the broker can consider the consumer dead and rebalance.
  • Use SASL PLAIN together with TLS to protect credentials in transit.

Limits

  • Consume functions are triggers and do not accept runtime parameters. Templates work in Produce functions only.

What teams use it for

OT data into the enterprise event bus

Plant events available to every team on Kafka.

Stream processing

Flink or Kafka Streams jobs on clean, keyed telemetry.

Decoupling apps from the broker

Consumers read Kafka without touching the plant's MQTT broker.

Ways to connect MQTT to Kafka

In general terms. Check any specific product for its own details.

Compare a custom script, a flow tool, a cloud vendor's edge service and MaestroHub

Swipe sideways to see every column

A custom scriptA flow toolA cloud vendor's edge serviceMaestroHub
Talks MQTTA library you chooseCommunity plug-insDepends on the vendorBuilt in, one of 90+ connectors
Names, units and schemaYou write itYou build itPartly, in the vendor's modelOne governed namespace
Quality on every valueYou write itYou build itDepends on the vendorBuilt in, carried through calculations
Where each value came fromYou write itYou build itDepends on the vendorStamped on every value
Survives a network outageYou build itYou build itUsually, to that vendor's cloudOn disk, per destination, in order
Several destinations at onceOne script eachYes, flow by flowMostly that vendor's cloudAny mix, each with its own buffer
Permissions and auditYou build itYou build itCloud account permissionsRoles, single sign-on, audit trail
AI agents can use the dataYou build itYou build itDepends on the vendorThrough the MCP server

Questions

How do I bridge MQTT data to Kafka?

Subscribe to the plant's MQTT topics with MaestroHub, check each message against its schema and quality, and produce it to Kafka topics with a key such as the machine id. Messages wait on disk if the Kafka cluster is unreachable and are delivered in order.

Do I need to write code to connect MQTT to Kafka?

No. You configure the MQTT connection and the Kafka output in MaestroHub and join them with a pipeline. Transformations can be added where you need them.

Where does MaestroHub run for this?

On your own infrastructure next to the machines: an edge box, a virtual machine or Kubernetes. Nothing has to leave your network.

Why not just write a script for MQTT to Kafka?

A script works on day one. The cost comes later: decoding and naming values, handling bad quality, buffering through outages, keeping credentials safe, and doing it again for the next machine and the next destination. MaestroHub does those once, for every connector.

What else can MQTT data go to?

More than 90 connectors are included in every edition, among them historians, databases, cloud warehouses, message brokers and business systems, so the same values can feed several destinations at once.

Try MQTT to Kafka yourself.

The free trial includes every connector. No factory to hand? The Digital Factory Simulator serves OPC UA, Modbus, MQTT and more on your laptop.

Cookie preferences

Choose which categories of cookies you allow. Strictly necessary cookies are always on because the site cannot function without them.