MQTT Data Receiver¶
The mqtt
data receiver retrieves data by subscribing to topics. Also includes support for sparkplug.
MQTT Example:
{ "data_receiver_name": "my_mqtt_receiver", "protocol": "mqtt", "connections": [ { "host": "some-host.local", "port": 1883, "username": "some_user", "password": "some_pass", "default_topic": "<insert topic name here. Used if stream topics undefined>" } ], "streams": [ { "asset": "asset", "stream_type": "stream_type", "topic": "<insert topic name here>" } ] }
Configuration:
Required and optional properties that can be configured for an Iot Hub receiver:
connections: How to connect to the MQTT server. A connection has the following configurable settings:
host: MQTT broker hostname (e.g.
broker.emqx.io
)port: MQTT connection port (Defaults to 1883)
client_id: Some unique string identifying the client to the MQTT server. Must be unique across all connections to the MQTT server.
username: Username to connect to the server
password: Password to connect to the server
version: The MQTT protocol version to use (Default is 3.1.1)
default_topic: Name of topic(s) to subscribe to. To subscribe to multiple topics, you can also use MQTT wildcards (‘+’, ‘#’)
plugin: MQTT provides additional protocols like sparkplug. The only option available here is “sparkplug” for the Sparkplug B format.
streams: Each input stream has the following configurable settings:
asset: Asset identifier
stream_type: Type of data stream
topic: Name of topic(s) to subscribe to. To subscribe to multiple topics, you can also use MQTT wildcards (‘+’, ‘#’) This option overrides default_topic if it is already configured.