Start a console consumer for that topic: .\bin\windows\kafka-console-consumer.bat --zookeeper localhost:2181 --topic kafkatest --from-beginning
From a fifth command line or your IDE run MultiBrokerProducer with topic as argument: java MultiBrokerProducer kafkatest
Ten messages starting with This message is for key - (...) should appear in the console consumer's log
Simple High Level Java Consumer (Chapter 6, Page 47ff.)
Launch multi-broker Kafka cluster and create topic kafkatest as described in step 1-8 of Java Producer with Message Partitioning
From another command line or your IDE run SimpleHLConsumer with topic as argument: java SimpleHLConsumer kafkatest
From another command line or your IDE run MultiBrokerProducer with same topic as argument: java MultiBrokerProducer kafkatest
Ten messages starting with This message is for key - (...) should appear in the log of the SimpleHLConsumer
Multithreaded Consumer for Multipartition Topics (Chapter 6, Page 50ff.)
Launch multi-broker Kafka cluster and create topic kafkatest as described in step 1-8 of Java Producer with Message Partitioning
From another command line or your IDE run MultiThreadHLConsumer with topic and number of threads as argument: java MultiThreadHLConsumer kafkatest 4
From another command line continuously produce messages by running MultiBrokerProducer several times in a row: java MultiBrokerProducer kafkatest (Note: You must start producing messages within 10sec after starting the consumer class, otherwise the consumer will shut down)
Messages starting with Message from thread (...) should appear in the log of the MultiThreadHLConsumer spread among the four threads