Testing Kafka

Finally, we can test our Kafka installation by creating a test topic as follows:

> bin/kafka-topics.sh --create --zookeeper 192.168.56.10:2181 --replication-factor 1 --partitions 1 --topic our-first-topic      $ Created topic "our-first-topic".> bin/kafka-topics.sh --list --zookeeper 192.168.56.10:2181      $ our-first-topic

Once we have created our test topic, let's start a command-line producer application and send some test messages to this topic as follows:

> bin/kafka-console-producer.sh --broker-list 192.168.56.10:9092 --topic our-first-topic > This is my 1st test message > This is my 2nd test message > This is my 3rd test message

Finally, let's start a command-line consumer application (in another Terminal session) to consume these ...

Get Machine Learning with Apache Spark Quick Start Guide 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.