MQTT Publisher
The MQTT Publisher destination publishes messages to a topic on an MQTT broker. The destination functions as an MQTT client that publishes messages, writing each record as a message. For information about supported versions, see Supported Systems and Versions in the Data Collector documentation.
When you configure the destination, you specify the information needed to connect to the MQTT broker. You must define connection credentials when the MQTT broker requires a user name and password. You can also use a connection to configure the destination.
You can also configure SSL/TLS properties, including default transport protocols and cipher suites.
The stage supports high availability MQTT clusters. For a cluster without a load balancer, you configure a list of brokers in the cluster. After losing a connection to a broker, the stage connects to the next available broker in the list.
You specify the topic on the MQTT broker that the destination delivers the message to.
You also configure the quality of service level and the persistence mechanism that the destination uses to enable reliable messaging.
Topic
The MQTT Publisher destination writes messages to a single topic on the MQTT broker. Any MQTT client subscribed to that topic receives the messages. A topic is a string that the broker uses to filter messages for each connected client.
sales/US/NorthernRegion
You cannot use MQTT wildcards in the topic name used by the MQTT Publisher destination.
For more information, see the HiveMQ documentation on MQTT topics.
Data Formats
The MQTT Publisher destination writes messages to an MQTT broker based on the data format that you select.
The MQTT Publisher destination processes data formats as follows:
- Binary
- The stage writes binary data to a single field in the record.
- JSON
- The destination writes records as JSON data. You can use one of
the following formats:
- Array - Each file includes a single array. In the array, each element is a JSON representation of each record.
- Multiple objects - Each file includes multiple JSON objects. Each object is a JSON representation of a record.
- SDC Record
- The destination writes records in the SDC Record data format.
- Text
- The destination writes data from a single text field to the destination system. When you configure the stage, you select the field to use.
Configuring an MQTT Publisher Destination
Configure an MQTT Publisher destination to write messages to an MQTT broker.