Apache Kafka
Apache Kafka
Kafka
jaydeep patil
Overview of the Event
Streaming
In programming, an event typically refers to an action
or occurrence that happens during the execution of a
program. It can be an interaction from a user, such as
clicking a button or pressing a key, or it can be a
system event, such as a timer or a network request
completing.
jaydeep patil
Also, this platform is used to process events and allow
the different consumers to process results
immediately and timely manner.
jaydeep patil
Introduction of Apache
Kafka
Apache Kafka is an open-source distributed
streaming platform.
jaydeep patil
Kafka has distributed system which has servers and
clients that can communicate via TCP protocol.
jaydeep patil
Main concepts and
foundation of Kafka
1. Event
Key: “Jaydeep”
Value: “Booked BMW”
Event Timestamp: “Dec. 11, 2022, at 12:00 p.m.”
2. Producer
3. Consumer
jaydeep patil
4. Kafka Cluster
5. Broker
6. Topic
The events are stored inside the Topic it’s similar to our
folder in which we store multiple files.
jaydeep patil
Each topic has one or more producers and consumer
which write and reads data from the topic.
7. Partitions
8. Offset
jaydeep patil
9. Consumer Groups
10. Replica
jaydeep patil
Different Kafka APIs
Admin API
This API manages different topics, brokers, and Kafka
objects
Producer API
This API is used to write/publish events to different Kafka
topics
Consumer API
This API is used to receive the different messages
corresponding to the topics which are subscribed by the
consumer
jaydeep patil
Use Cases of Apache Kafka
Following are the use cases of Kafka
Messaging Systems
Log Aggregation
Stream Processing
Event Sourcing
Microservices Communication
jaydeep patil
Installation of Kafka on
Windows 10
Step 1
https://www.oracle.com/java/technologies/downloads/#j
ava8
Step 2
Step 3
jaydeep patil
Step 4
https://kafka.apache.org/downloads
Step 5
Step 6
Step 7
D:\Kafka\config\zookeeper.properties
dataDir=D:/Kafka/zookeeper-data
jaydeep patil
Step 8
D:\Kafka\config\server.properties
log.dirs=D:/Kafka/kafka-logs
Step 9
Step 10
Run zookeeper
D:\Kafka> .\bin\windows\zookeeper-server-start.bat
.\config\zookeeper.properties
jaydeep patil
Step 11
Start Kafka
D:\Kafka>.\bin\windows\kafka-server-start.bat
.\config\server.properties
Step 12
D:\Kafka>\bin\windows>kafka-topics.bat — create —
bootstrap-server localhost:9092 — replication-factor 1 —
partitions 1 — topic testdata
jaydeep patil
Step 13
D:\Kafka\bin\windows>kafka-console-producer.bat —
broker-list localhost:9092 — topic testdata
Step 14
D:\Kafka\bin\windows>kafka-console-consumer.bat —
bootstrap-server localhost:9092 — topic testdata
jaydeep patil
Thank You
www.linkedin.com/jaydeep patil