This Hello World customization uses a Mqtt-to-Kafka transformer which forwards MQTT PUBLISHES to a Kafka cluster. It maps the MQTT topic structure to a matching Kafka topic structure and preserves MQTT 5 user properties as Kafka record headers.
We strongly recommend reading the HiveMQ Enterprise Extension for Kafka Documentation to grasp the core concepts of HiveMQ Kafka customization development.
-
Clone this repository into a Java 11 gradle project.
-
Run
./gradlew jar
task from gradle to build the customization. -
Move the file: "build/libs/hivemq-kafka-hello-world-customization-4.35.0.jar" to the directory: "HIVEMQ_HOME/extensions/hivemq-kafka-extension/customizations"
-
Copy the resources/kafka-configuration.xml to "HIVEMQ_HOME/extensions/hivemq-kafka-extension" and adapt it to your environment.
-
Delete the "HIVEMQ_HOME/extensions/hivemq-kafka-extension/DISABLED" file.
-
Start HiveMQ.
Connect with an MQTT client of your choice. Publish a MQTT message to the topic transform/customization. Monitor your Kafka cluster for a record from topic transform.customization.
Awesome, you got your first HiveMQ Kafka customization working.
Now read the HiveMQ Kafka Extension Customization Documentation to see what customizations can do.
If you encounter any problems, we are happy to help. The best place to get in contact is our community forum.
HiveMQ Kafka Extension Hello World Customization is licensed under the APACHE LICENSE, VERSION 2.0
.
A copy of the license can be found here.