"Hello World" for Apache Kafka
First, install the WarpStream Agent for your platform.
Running the WarpStream Agent
The playground
command will start an Agent on localhost
, store all the data for the Agent in memory, and sign up for a temporary account for you to play around with.
Create a Topic
Let's create a topic using the Apache Kafka client built-in to the WarpStream Agent. We're going to assume in this tutorial you're running the Agent as specified above on localhost, so we'll omit the arguments to specify the Kafka bootstrap URL. Open a second terminal and issue the following command:
If you don't receive an error back, your request to create the topic succeeded.
Add Records To The Topic
Now let's write a record to the topic. The kcmd
tool writes records with a constant key of "hello", and we'll write two records with the payload of "world
" as our example (,,
) is the delimiter).
You should receive output in your terminal that looks something like this:
Read Records From The Topic
Now you should see your records you wrote previously printed to the console. The key is always "hello" and the value field is the same "world" string we wrote before. You can repeat the process of writing another record and running kcmd --type fetch
again to read and write more records.
And that's it! You've successfully set up a WarpStream Agent Pool to power your Virtual Cluster, created a topic, and processed some data through it.
You can now move on to trying to create a real application which reads or writes from the topic, or connect your existing tools like Flink to WarpStream.
Last updated