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

Connected

Exercise

Using kafka-console-producer.sh

While learning about Apache Kafka, you decide to start working on an example project to store data about potential phishing websites in Kafka. Your company provides some security tools that can utilize this type of information to better protect users. Before implementing the project, you'd like to make sure you understand how to interact with Kafka by writing information via the command-line.

Reference: Phishing is a cyber-security term used to describe email messages designed to steal personal information or otherwise harm end users.

Instructions 1/2

undefined XP
  • 1
    • Use the bin/kafka-console-____ --bootstrap-server localhost:9092 --topic <topic> to connect to the phishing-sites topic using the appropriate options.
    • Write a few messages of your choice into the topic (pressing enter after each line).
    • Press control+c to exit the kafka-console-producer once you've finished writing messages.
  • 2
    • Use the command echo "This is a test message and use the | (pipe) symbol to pass it to the appropriate console producer command.