This repository contains the demo for the DevNation Live tech talk about Getting Started with Apache Kafka.
git clone https://github.com/scholzj/getting-started-with-apache-kafka.git
cd getting-started-with-apache-kafka
curl -LO https://www.apache.org/dist/kafka/2.0.0/kafka_2.11-2.0.0.tgz
tar -xzf kafka_2.11-2.0.0.tgz
cd kafka_2.11-2.0.0
bin/zookeeper-server-start.sh config/zookeeper.properties
bin/kafka-server-start.sh config/server.properties
devnation
with 3 partitions and 3 replicas
bin/kafka-topics.sh --zookeeper localhost:2181 --create --topic devnation --partitions 3 --replication-factor 1
echo "Hello World from CLI" | bin/kafka-console-producer.sh --broker-list localhost:9092 --topic devnation
bin/kafka-console-consumer.sh --bootstrap-server localhost:9092 --from-beginning --topic devnation --max-messages 1
cd ../java
mvn compile exec:java -Dexec.mainClass="kafka.MessageConsumer"
mvn compile exec:java -Dexec.mainClass="kafka.MessageProducer"
cd ../spring
mvn spring-boot:run
curl -sv -X POST -H "Content-Type: text/plain" http://localhost:8080/kafka/ --data 'Hello World from Spring'
cd ../python
pip install confluent-kafka
python consumer.py
python producer.py
cd ../node.js
node-rdkafka
client
npm install node-rdkafka
node consumer.js
node producer.js