RisingWave [1] is a distributed stream database that provides a standard SQL interface compatible with the PostgreSQL ecosystem, allowing integration without the need for code modification. RisingWave treats streams as tables, enabling users to write complex queries on both streaming and historical data. With RisingWave, users can concentrate on query analytical logic without having to learn Java or the underlying API of specific systems. This article will guide you on how to import data from AutoMQ into the RisingWave database using RisingWave Cloud [2].Documentation Index
Fetch the complete documentation index at: https://docs.automq.com/llms.txt
Use this file to discover all available pages before exploring further.
Prepare AutoMQ and Test Data
Refer to Deploy Multi-Nodes Cluster on Linux▸ for instructions on deploying AutoMQ, ensuring network connectivity between AutoMQ and RisingWave. Quickly create a topic namedexample_topic in AutoMQ, and write a test JSON data to it by following these steps.
Create Topic
Use the Apache Kafka command line tool to create the Topic. Ensure you have access to a Kafka environment and the Kafka service is running. Below is an example command to create the Topic:Generate Test Data
Generate test data in JSON format that corresponds to the table mentioned earlier.Write Test Data
Use Kafka’s command line tool or programming methods to write the test data into the Topic named example_topic. Below is an example using the command line tool:Creating an AutoMQ Source on RisingWave Cloud
- Go to RisingWave Cloud Clusters [3] to set up a cluster.
- Go to RisingWave Cloud Source [4] to set up a source.
- Specify the cluster and database, and log in to the database.
- AutoMQ is 100% compatible with Apache Kafka®. Click Create source and select Kafka.
- Configure the connector according to the RisingWave Cloud guided interface, setting the source information and schema details.
- Confirm the generated SQL statement and click Confirm to complete the creation of the source.
The default port for AutoMQ is 9092, and SSL is not enabled. If you need SSL, see the Apache Kafka Documentation [5].In this example, you can set the startup mode to earliest and use JSON format to access all data from the topic from the beginning.
Query Data
- Go to RisingWave Cloud Console [6] and log into your cluster.
- Run the following SQL statement to access the imported data, replacing the variable your_source_name with the custom name specified when creating the source.