Setting Up HiveMQ Kafka Extension for Redpanda Cluster Connectivity
This guide aims to facilitate the setup process of the HiveMQ Kafka extension for seamless integration with a Redpanda cluster. The steps outlined below ensure a smooth configuration process, enabling efficient communication between HiveMQ and Redpanda.
Prerequisites
Before proceeding with the setup, ensure the following prerequisites are met:
A running Redpanda cluster. For the purpose of this guide, we utilize RedPanda’s cloud serverless cluster.
Authenticating user should have appropriate permissions configured on the Redpanda cluster.
The latest version of the HiveMQ.
Instructions
Create Kafka Config.xml:
Begin by creating a Kafka config.xml file to establish a connection with the Redpanda cluster. Ensure to configure the cluster URL, username, and password (SHA256) provided by the Redpanda cluster.
Below is a sample configuration snippet:
Enable the HiveMQ Kafka Extension:
Remove the DISABLED file from the hivemq-kafka-extension folder to enable the extension.Start the hivemq broker
Start the HiveMQ Broker:
Confirmation of Extension Activation:
Upon successful startup, verify hivemq logs that the extension is activated with the configured MQTT-to-Kafka mapping.
Sample logs:2024-04-16 11:52:48,997 INFO - mKqRA: no members discovered after 2001 ms: creating cluster as first member 2024-04-16 11:52:49,323 INFO - Started mqtt-to-kafka mapping "mapping01" with MQTT topics [#] and Kafka topic "kafka-topic" for Kafka Cluster "cluster01" 2024-04-16 11:52:49,323 INFO - No mqtt-to-kafka transformers were found. No mqtt-to-kafka transformers are started. 2024-04-16 11:52:49,323 INFO - No kafka-to-mqtt mappings were found. No kafka kafka-to-mqtt mappings are started. 2024-04-16 11:52:49,324 INFO - No kafka-to-mqtt transformers were found. No kafka kafka-to-mqtt transformers are started. 2024-04-16 11:52:49,324 INFO - Extension "HiveMQ Enterprise Extension for Kafka" version 4.27.0 started successfully.
Testing:
Conduct a quick test by publishing messages and observing their transmission within the Redpanda cluster's console interface.
Following these steps ensures the successful integration of HiveMQ with a Redpanda cluster, enabling efficient data exchange and communication within the ecosystem.
Since we are using Redpanda free cloud cluster, we have added internal option configuration in our Kafka extension’s config.xml to set the replication factor as 3. This was required for a successful connection with Redpanda’s cloud serverless cluster.