Install Kafka using helm
Enabling Kafka extension
Configuring the extension and Kafka
End-to-end testing
...
HiveMQ Enterprise Extension For Kafka requires a separate license file, e.g. kafka-license.elic, in the $HIVEMQ_HOME/license directory. You can skip this step. If you skip this step, then the kafka-extension will start in trial mode, limited to 5h, and will be automatically disabled by the HiveMQ broker after 5h. To add the kafka-license.elic along with the hivemq-license.lic, create a new configmap hivemq-license including all desired license files:
Code Block language bash kubectl create configmap hivemq-license --namespace=hivemq \ --from-file hivemq-licesen.lic \ --from-file kafka-license.elic
Edit the values.yaml file of the hivemq-operator, section
hivemq.configMaps
. Update this:Code Block configMaps: [] # ConfigMaps to mount to the HiveMQ pods. These can be mounted to existing directories without shadowing the folder contents as well. #- name: hivemq-license # path: /opt/hivemq/license
To this:
Code Block configMaps: - name: hivemq-license path: /opt/hivemq/license
This will mount the content of the configMap
hivemq-license
to the directory/opt/hivemq/license
of the hivemq-broker pods.HiveMQ Enterprise Extension For Kafka is preinstalled with HiveMQ so once you enable it, it will look for its configuration file. You must prepare this file before enabling the extension. If you skip this step, the extension will not find its configuration file and will not load any configuration.
Prepare a simple configuration file for kafka-extension as in the example below.
this example configuration will map all incoming MQTT publish packets to the topic “test” in Kafka; and will map the topic “test” in Kafka to the topic “test-test” in the HiveMQ broker
Use your password in
<password>here_is_your_password</password>
, that you successfully retrieved with this command a few steps ago:Code Block language bash kubectl get secret kafka-user-passwords --namespace kafka \ -o jsonpath='{.data.client-passwords}' | base64 -d | cut -d , -f 1;
Here is the file:
...