Set up a HiveMQ broker
This section provides step-by-step instructions for creating a HiveMQ broker on HiveMQ Cloud and connecting it to RisingWave for real-time data ingestion and analytics. This setup is ideal for IoT messaging and processing workflows. For additional details, refer to the official HiveMQ Documentation.1. Sign up for HiveMQ Cloud
To begin, sign up for a free trial of HiveMQ Cloud at HiveMQ Cloud. This service offers cloud-based, enterprise-grade MQTT capabilities tailored for IoT messaging.
2. Create a HiveMQ cluster
After signing in, follow these steps to create a new HiveMQ cluster:- Select Create New Cluster.
- Choose between Serverless and Starter cluster options. Select Serverless for a fast, easy setup.


3. Configure cluster access
To securely connect and interact with the HiveMQ broker, you’ll need to set up user credentials:- Add a username and password.
- Assign the necessary permissions to publish and subscribe to the MQTT topics.

4. Cluster details
You’ll now have access to your cluster details, which include: Cluster name, Current plan, Cloud provider, Cluster URL and port, and WebSocket URL and port. These details are essential for connecting to the HiveMQ broker using MQTT clients.
Set up a RisingWave cluster
To ingest data into RisingWave, you’ll need to create a RisingWave cluster. Sign up for a free plan at RisingWave Cloud to explore its features. You can refer to the RisingWave Documentation for comprehensive, step-by-step instructions. For further assistance or to join the community, connect with us on Slack.
1. Create a data source in RisingWave
Use the following SQL query to create a table callediot_sensor_data
in RisingWave. This table will store incoming data from your HiveMQ broker:
- device_id represents the IoT device identifier.
- ts is the timestamp.
- temperature and humidity represent sensor readings.
- device_status indicates whether the device is in a normal or abnormal state.
2. Query the data source
You can query theiot_sensor_data
table to view the latest records using the following SQL query:
