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 mqtt-service:
- Create ${IOTDB_HOME}/ext/mqtt/ folder, and put the jar into this folder. ** Start an IoTDB MqttService (in the mqtt-service module).
- Set the value of program parameter
-mqtt_payload_formatter as the value of getName() in your implementation - Launch the IoTDB server.
- Now IoTDB will use your implementation to parse the MQTT message.