Creating Kafka topics to stream data
In the previous recipe, we orchestrated our Kafka broker. The next step is obviously putting Kafka to action. In order to do that, we need some topics to work with. In this recipe, we will create some topics and will also learn how to produce and consume messages. Exchanging messages can be done in two ways: scripts and Java programs. We will be learning the Java way.
Getting ready
In this recipe, we will be using the same Kafka topics script to create topics:
- Open a new terminal shell and navigate to the directory where you have Kafka installed.
- Let's create a new topic called
geolocations
. We will then write a basic standalone producer program that will produce geolocations for this topic. We will integrate a ...
Get Microservices Deployment Cookbook now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.