tree: 58deb902d5382f5254943e06df2fac7116cad9ee [path history] [tgz]
  1. src/
  2. pom.xml
  3. README.md
example/mqtt-customize/README.md

Customized IoTDB-MQTT-Broker Example

Function

The example is to show how to customize your MQTT message format

Usage

  • Define your implementation which implements PayloadFormatter.java
  • modify the file in src/main/resources/META-INF/services/org.apache.iotdb.db.mqtt.PayloadFormatter: clean the file and put your implementation class name into the file
  • compile your implementation as a jar file

Then, in your server:

  • Create ${IOTDB_HOME}/ext/mqtt/ folder, and put the jar into this folder.
  • Update configuration to enable MQTT service. (enable_mqtt_service=true in iotdb-datanode.properties)
  • Set the value of mqtt_payload_formatter in conf/iotdb-datanode.properties as the value of getName() in your implementation
  • Launch the IoTDB server.
  • Now IoTDB will use your implementation to parse the MQTT message.