MQTT Connector
Overview
Section titled “Overview”The MQTT connector enables publish/subscribe messaging for IoT devices using MQTT v3 protocol.
Connector Types:
MqttV3Reader- Subscribe to MQTT topicsMqttV3Writer- Publish to MQTT topics
MQTT Reader
Section titled “MQTT Reader”Subscribe to MQTT topics and receive messages:
{ "type": "MqttV3Reader", "config": { "endpoint": "localhost:1883", "topic": "sensors/temperature", "qos": 0, "clientId": "meddle-reader" }}With Authentication
Section titled “With Authentication”{ "type": "MqttV3Reader", "config": { "endpoint": "mqtt.example.com:1883", "topic": "factory/sensors/#", "qos": 1, "clientId": "meddle-reader", "username": "mqtt_user", "password": "mqtt_password" }}MQTT Writer
Section titled “MQTT Writer”Publish messages to MQTT topics:
{ "type": "MqttV3Writer", "config": { "endpoint": "localhost:1883", "topic": "data/output", "qos": 0, "clientId": "meddle-writer" }}Configuration Parameters
Section titled “Configuration Parameters”- endpoint: MQTT broker address (host:port)
- topic: Topic to subscribe/publish (supports wildcards for reader:
+,#) - qos: Quality of Service (0, 1, or 2)
- clientId: Unique client identifier
- username: (Optional) MQTT username
- password: (Optional) MQTT password
QoS Levels
Section titled “QoS Levels”- 0: At most once (fire and forget)
- 1: At least once (acknowledged delivery)
- 2: Exactly once (assured delivery)
Topic Wildcards (Reader Only)
Section titled “Topic Wildcards (Reader Only)”- +: Single level wildcard (
sensors/+/temperature) - #: Multi-level wildcard (
sensors/#)