1. Learn
  2. /
  3. Courses
  4. /
  5. Introduction to Apache Kafka

Connected

Exercise

Writing to and reading from a topic

After testing the basics of the Kafka components, you decide to work through the process of writing to a topic then reading from it. This will illustrate the process one would follow with working with Kafka from a user standpoint.

Instructions 1/3

undefined XP
  • 1
    • Use the appropriate Kafka console command to determine which topics exist on the system. Remember to include a --bootstrap-server option.
  • 2
    • Using the topic you found in step 1, copy and paste the following lines into the terminal and press enter. Make sure to press control+c when complete.
    "2024-03-31 23:03:48","5.80","http://y.github.io/Netflix-Landing-Page-Clone-","185.199.110.153"
    "2024-03-31 23:03:44","2.80","http://worker-frosty-hall-64f6.jc.workers.dev/","2606:4700:3032::ac43:d707"
    "2024-03-31 23:03:43","3.50","http://willconsultancy.com/wp-content/-/splonline","45.121.147.137"
    
  • 3
    • Read the content of the topic from the beginning with the appropriate Kafka console tool. You'll likely need to use control+c to exit the consumer.