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:When executing the command, replace the
topic
and bootstrap-server
with the actual Kafka server address.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:When executing the command, replace the
topic
and bootstrap-server
with the actual Kafka server address.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®, so simply 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, please consult 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.