In today’s IoT and industrial environments, lightweight, efficient protocols for pushing data are essential. MQTT is a purpose-built protocol for just that — ideal for constrained networks and systems where devices must publish events reliably without overhead. TDengine TSDB-Enterprise now includes built-in support for publishing data via MQTT, making it easy to stream time-series data to external systems and devices in real time.
What MQTT Publishing Enables
With TDengine’s MQTT data publishing, you can:
- Broadcast sensor data, device statuses, or other real-time metrics to MQTT brokers.
- Integrate time-series output with dashboards, alerting systems, or any consumer that speaks MQTT.
- Use metadata and topic configuration to structure how tables, tags, and data flow are represented on the MQTT side.
How It Works
The general workflow publish TDengine TSDB data over MQTT is as follows:
- Set up an MQTT broker: You can use EMQX, Mosquitto, or another MQTT server dependent on your performance, scalability, or feature requirements.
- Install and run TDengine TSDB-Enterprise: Refer to our quick start guide to deploy TDengine TSDB-Enterprise. Make sure the
taosd
andtaosx
services are installed and running. - Prepare your data: Use TDengine TSDB Explorer or the command-line interface to create your database and supertable. Then create a topic and start writing data.
- Create an MQTT publishing task: Use taosX to map a TDengine topic (or set of topics) to an MQTT broker. You supply connection parameters, choose the MQTT version, QoS level, topic naming, and whether metadata (table creations, deletions, etc.) should also be published.
- Verify the data flow: Use an MQTT client like MQTTX to subscribe to the target topic and see whether messages are arriving as expected. The payload will include data fields, metadata like table name, timestamp, and offset info so consumers can reconstruct or filter important information.

For detailed instructions, see the documentation.
Key Parameters & Considerations
When setting up MQTT publishing, keep the following parameters in mind:
- QoS Level: Dictates how reliable the delivery is. QoS 0 is “send once, no guarantee”; QoS 1 ensures at least once delivery.
- Protocol Version: Some clients or brokers may require a specific MQTT version (3.1, 3.1.1, or 5.0), so align this in your config.
- Metadata Synchronization: If you enable metadata sync, you can publish structural changes (new tables, tags, deletes) so consumers can stay up to date without manual configuration.
- Topic Templates: You can use variables in topic names or metadata topics (e.g. database name, vgroup id, table name) to structure topic hierarchy or allow routing based on metadata.
Real-World Use Cases
The following scenarios can particularly benefit from MQTT publishing with TDengine:
- Edge devices & dashboards: Devices can subscribe in lightweight fashion to relevant topics; dashboards can consume updated readings in near real time.
- Alerting or monitoring systems: If certain thresholds are crossed, you can push those events via MQTT for immediate reaction.
- Interoperability & integration: Systems already using MQTT (like IoT platforms or message brokers) can now pull in TDengine data without building custom adapters.
Conclusion
Integrating TDengine with MQTT publishing turns your time-series data into live streams that can feed dashboards, alerting systems, or any MQTT-ready consumer. For industrial, IoT, or edge computing use cases, this capability bridges the database and the event/stream side of your architecture, giving you flexibility, real-time visibility, and efficient data distribution.
If you’re thinking about deploying MQTT publishing, next steps might include trying it out with sample data, designing topic structure and metadata strategy, and benchmarking how your broker handles your data volume. When configured right, this feature adds powerful connectivity to TDengine’s time-series platform.