Skip to content

Learn to harness the power of Apache Kafka locally with ease! This repository provides simple scripts and guides to set up Kafka using Docker and Node.js. Ideal for developers interested in real-time data processing and distributed systems. Dive in, experiment, and accelerate your Kafka journey today! 🚀

Notifications You must be signed in to change notification settings

anfal11/kafka-local

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Here are simplified commands for users to run Kafka locally, along with a brief description:

Start Zookeeper Container

Start Zookeeper container and expose port 2181:

docker run -p 2181:2181 zookeeper

Start Kafka Container

Start Kafka container, expose port 9092, and set up environment variables:

docker run -p 9092:9092 \
-e KAFKA_ZOOKEEPER_CONNECT=<PRIVATE_IP>:2181 \
-e KAFKA_ADVERTISED_LISTENERS=PLAINTEXT://<PRIVATE_IP>:9092 \
-e KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR=1 \
confluentinc/cp-kafka

Replace <PRIVATE_IP> with the private IP address of your machine.

Create Kafka Topic

Create a Kafka topic named "rider-updates" with 2 partitions:

node admin.js

Run Consumer

Run a Kafka consumer:

node consumer.js <GROUP_NAME>

Replace <GROUP_NAME> with the name of the consumer group.

Run Producer

Run a Kafka producer:

node producer.js

Enter rider name and location as prompted, e.g., tony south, tony north.

DEMO Screenshots:

image

image

About

Learn to harness the power of Apache Kafka locally with ease! This repository provides simple scripts and guides to set up Kafka using Docker and Node.js. Ideal for developers interested in real-time data processing and distributed systems. Dive in, experiment, and accelerate your Kafka journey today! 🚀

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published