Data to HStreamDB
For more details, please refer to HStream official website (opens new window)。
Refer to the following documents (opens new window) for deployment instructions, which provide tutorials on deploying with docker locally or on the cloud.
Use the command to start an hstream-client
When entering the console, help info like these will be shown:
/ / / / ___/_ __/ __ \/ ____/ | / |/ /
/ /_/ /\__ \ / / / /_/ / __/ / /| | / /|_/ /
/_/ /_//____//_/ /_/ |_/_____/_/ |_/_/ /_/
Command
:q To exit command line interface
Create stream:
Click on Rules Engine
> Resources
> Create
, then select resources type HStreamDB.
Edit the rule SQL.
SELECT
FROM
The SQL rules in the document are for demonstrations only, please write the SQL according to the business design.
Click Add Action and select Data Persistence to save the data to HSTreamDB. Select the resource created in the previous step and enter the parameters, which are defined in the following table.
Click Confirm
to create it.
Now use the state-of-the-art MQTT desktop client MQTTX
to connect to EMQX and send a message.
See rule monitor.
At this point the data is written to HStreamDB and the message is consumed using any consumption method. The documentation uses a simple consumption tool based on the HStream golang SDK, and the reader is free to write the consumption side according to a familiar programming language. The consumption log can be seen as follows. Test tool see .
{"level":"info","ts":1656311005.5250711,"msg":"[f1]","recordId":"[BatchId: 8589934593, BatchIndex: 0, ShardId: 1317059070792293]","payload":"Hello HSreamDB !"}
The message has been written successfully and is consumed to completion.