curl "http://mirror.metrocast.net/apache/kafka/0.10.2.0/kafka_2.12-0.10.2.0.tgz" | tar xz
Windows:
zookeeper-server-start.bat ..\..\config\zookeeper.properties
MAC/Unix:
./zookeeper-server-start.sh ../config/zookeeper.properties
Windows:
kafka-server-start.bat ..\..\config\server.properties
MAC/Unix :
./kafka-server-start.sh ../config/server.properties
Windows
kafka-topics.bat --describe --zookeeper localhost:2181
MAC:
./kafka-topics.sh --describe --zookeeper localhost:2181
Windows
kafka-topics.bat --describe --topic replicate_topic --zookeeper localhost:2181
MAC:
./kafka-topics.sh --describe --topic replicate_topic --zookeeper localhost:2181
Windows
kafka-topics.bat --create --topic demo-project -zookeeper localhost:2181 --replication-factor 1 --partitions 1.
Example:
kafka-topics.bat --create --topic demo-project -zookeeper localhost:2181 --replication-factor 1 --partitions 1.
MAC:
./kafka-topics.sh --create --topic demo-project -zookeeper localhost:2181 --replication-factor 1 --partitions 1
Example:
The below command creates a topic called demo-project.
./kafka-topics.sh --create --topic demo-project -zookeeper localhost:2181 --replication-factor 1 --partitions 1
Please see Java code :
Windows:
kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic <topic-name> --from-beginning
Example:
kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic demo-project --from-beginning.
MAC
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic <topic-name> --from-beginning
Example:
./kafka-console-consumer.sh --bootstrap-server localhost:9092 --topic demo-project --from-beginning