SlideShare a Scribd company logo
Apache Kafka is a fast, scalable, durable and
distributed messaging system.

 We need basic Java programming skills plus access
to:
 Apache Kafka 0.9.0
 Apache Maven 3.0 or later
 Git
 Step 1: Download Kafka
Download the Apache Kafka 0.9.0release and un-tar
it.
Prerequisites & Installation

Kafka is designed for distributed high
throughput systems. Kafka tends to work very
well as a replacement for a more traditional
message broker. In comparison to other
messaging systems, Kafka has better throughput,
built-in partitioning, replication and inherent
fault-tolerance, which makes it a good fit for
large-scale message processing applications.


 A Messaging System is responsible for transferring
data from one application to another, so the
applications can focus on data, but not worry about
how to share it. Distributed messaging is based on
the concept of reliable message queuing. Messages
are queued asynchronously between client
applications and messaging system. Two types of
messaging patterns are available − one is point to
point and the other is publish-subscribe (pub-sub)
messaging system. Most of the messaging patterns
follow pub-sub.
What is a Messaging
System?

 In a point-to-point system, messages are persisted in
a queue. One or more consumers can consume the
messages in the queue, but a particular message can
be consumed by a maximum of one consumer only.
Once a consumer reads a message in the queue, it
disappears from that queue. The typical example of
this system is an Order Processing System, where
each order will be processed by one Order Processor,
but Multiple Order Processors can work as well at
the same time. The following diagram depicts the
structure.
Point to Point Messaging
System
Sender
Message
Queue
Receiver
 In the publish-subscribe system, messages are persisted
in a topic. Unlike point-to-point system, consumers can
subscribe to one or more topic and consume all the
messages in that topic. In the Publish-Subscribe system,
message producers are called publishers and message
consumers are called subscribers. A real-life example is
Dish TV, which publishes different channels like sports,
movies, music, etc., and anyone can subscribe to their
own set of channels and get them whenever their
subscribed channels are available.
Publish-Subscribe
Messaging System
Sender
Message
Queue
Receiver
Receiver
Receiver

 Following are a few benefits of Kafka −
 Reliability − Kafka is distributed, partitioned, replicated and
fault tolerance.
 Scalability − Kafka messaging system scales easily without
down time..
 Durability − Kafka uses Distributed commit log which means
messages persists on disk as fast as possible, hence it is
durable..
 Performance − Kafka has high throughput for both publishing
and subscribing messages. It maintains stable performance
even many TB of messages are stored.
 Kafka is very fast and guarantees zero downtime and zero data
loss.
Benefits

 Kafka is a unified platform for handling all the real-time
data feeds. Kafka supports low latency message delivery
and gives guarantee for fault tolerance in the presence of
machine failures. It has the ability to handle a large
number of diverse consumers. Kafka is very fast,
performs 2 million writes/sec. Kafka persists all data to
the disk, which essentially means that all the writes go to
the page cache of the OS (RAM). This makes it very
efficient to transfer data from page cache to a network
socket.

Need for Kafka

 such as topics, brokers, producers and consumers.
 Topics: A stream of messages belonging to a particular category is
called a topic. Data is stored in topics
 Partition:Topics may have many partitions, so it can handle an
arbitrary amount of data.
 Partition offset: Each partitioned message has a unique sequence id
called as offset
 Replicas of partition: Replicas are nothing but backups of a partition.
Replicas are never read or write data. They are used to prevent data
loss.
 Brokers
 Brokers are simple system responsible for maintaining the pub-lished
data. Each broker may have zero or more partitions per topic. Assume,
if there are N partitions in a topic and N number of brokers, each
broker will have one partition.
Kafka main
terminologies

 The sample Producer is a classical Java application with a
main() method, this application must:
 Initialize and configure a producer
 Use the producer to send messages
 1- Producer Initialization
Create a producer is quite simple, you just need to create an
instance of the
org.apache.kafka.clients.producer.KafkaProducer class with a
set of properties, this looks like:
 producer = new KafkaProducer(properties); In this example,
the configuration is externalized in a property file, with the
following entries:
Producer


Once you have a producer instance you can post
messages to a topic using the ProducerRecord class. The
ProducerRecord class is a key/value pair where:
 the key is the topic
 the value is the message
 As you can guess sending a message to the topic is
straight forward:
 ... producer.send(new ProducerRecord("fast-messages",
"This is a dummy message")); ...
2- Message posting

Once you are done with the producer use
the producer.close() method that blocks the process
until all the messages are sent to the server. This call is
used in a finally block to guarantee that it is called. A
Kafka producer can also be used in a try with resources
construct.
 ... }
 finally { producer.close();
 }
Producer End

 The Consumer class, like the producer is a simple
Java class with a main method.
 This sample consumer uses the Hdr Histogram
library to record and analyze the messages received
from the fast-messages topic, and Jackson to parse
JSON messages.
Consumer

 ZooKeeper is used for managing and coordinating
Kafka broker. ZooKeeper service is mainly used to
notify producer and consumer about the presence of
any new broker in the Kafka system or failure of the
broker in the Kafka system. As per the notification
received by the Zookeeper regarding presence or
failure of the broker then pro-ducer and consumer
takes decision and starts coordinating their task with
some other broker.
 Kafka stores basic metadata in Zookeeper such as
information about topics, brokers, consumer offsets
(queue readers) and so on.
ZooKeeper

More Related Content

What's hot

Apache kafka
Apache kafkaApache kafka
Apache kafka
Jemin Patel
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
Chhavi Parasher
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developers
confluent
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
AIMDek Technologies
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Saroj Panyasrivanit
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin Podval
Martin Podval
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
Srikrishna k
 
Apache Kafka - Patterns anti-patterns
Apache Kafka - Patterns anti-patternsApache Kafka - Patterns anti-patterns
Apache Kafka - Patterns anti-patterns
Florent Ramiere
 
Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)
Timothy Spann
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
Knoldus Inc.
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
Kumar Shivam
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?
confluent
 
Kafka: Internals
Kafka: InternalsKafka: Internals
Kafka: Internals
Knoldus Inc.
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
David Groozman
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
Diego Pacheco
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
Mohammed Fazuluddin
 
A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
Paul Brebner
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
Dmitry Tolpeko
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
Clement Demonchy
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
Jiangjie Qin
 

What's hot (20)

Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Fundamentals of Apache Kafka
Fundamentals of Apache KafkaFundamentals of Apache Kafka
Fundamentals of Apache Kafka
 
Apache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and DevelopersApache Kafka Fundamentals for Architects, Admins and Developers
Apache Kafka Fundamentals for Architects, Admins and Developers
 
Introduction to Apache Kafka
Introduction to Apache KafkaIntroduction to Apache Kafka
Introduction to Apache Kafka
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Apache Kafka - Martin Podval
Apache Kafka - Martin PodvalApache Kafka - Martin Podval
Apache Kafka - Martin Podval
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Apache Kafka - Patterns anti-patterns
Apache Kafka - Patterns anti-patternsApache Kafka - Patterns anti-patterns
Apache Kafka - Patterns anti-patterns
 
Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)Hello, kafka! (an introduction to apache kafka)
Hello, kafka! (an introduction to apache kafka)
 
Stream processing using Kafka
Stream processing using KafkaStream processing using Kafka
Stream processing using Kafka
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?Kafka Streams: What it is, and how to use it?
Kafka Streams: What it is, and how to use it?
 
Kafka: Internals
Kafka: InternalsKafka: Internals
Kafka: Internals
 
Kafka internals
Kafka internalsKafka internals
Kafka internals
 
Apache Kafka
Apache KafkaApache Kafka
Apache Kafka
 
Kafka presentation
Kafka presentationKafka presentation
Kafka presentation
 
A visual introduction to Apache Kafka
A visual introduction to Apache KafkaA visual introduction to Apache Kafka
A visual introduction to Apache Kafka
 
Apache Kafka - Messaging System Overview
Apache Kafka - Messaging System OverviewApache Kafka - Messaging System Overview
Apache Kafka - Messaging System Overview
 
Kafka 101
Kafka 101Kafka 101
Kafka 101
 
Producer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache KafkaProducer Performance Tuning for Apache Kafka
Producer Performance Tuning for Apache Kafka
 

Viewers also liked

如何滅除痛苦
如何滅除痛苦如何滅除痛苦
如何滅除痛苦
宏 恆
 
Web search-metrics-tutorial-www2010-section-6of7-freshness
Web search-metrics-tutorial-www2010-section-6of7-freshnessWeb search-metrics-tutorial-www2010-section-6of7-freshness
Web search-metrics-tutorial-www2010-section-6of7-freshness
Ali Dasdan
 
Buyer presentation
Buyer presentationBuyer presentation
Buyer presentation
Beth Larson
 
Jsf 2
Jsf 2Jsf 2
Lutein plus
Lutein plusLutein plus
Lutein plus
Zoran Stojcevski
 
20160821 a parábola do semeador
20160821 a parábola do semeador20160821 a parábola do semeador
20160821 a parábola do semeador
Flavio Brim
 
Spirulina chlorella plus
Spirulina chlorella plusSpirulina chlorella plus
Spirulina chlorella plus
Zoran Stojcevski
 
Pseudo-addiction
Pseudo-addictionPseudo-addiction
Pseudo-addiction
Paul Coelho, MD
 
Zvit-vihovna
Zvit-vihovnaZvit-vihovna
Zvit-vihovna
tetiana1958
 
Differently-abled Heroes of India; awarded by Limca book of records
Differently-abled Heroes of India; awarded by Limca book of recordsDifferently-abled Heroes of India; awarded by Limca book of records
Differently-abled Heroes of India; awarded by Limca book of records
ATUL RAJA
 
Essential skills of a teacher
Essential skills of a teacherEssential skills of a teacher
Essential skills of a teacher
Tin Arevalo
 
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
ATUL RAJA
 
Journalism: Guidelines and Steps in Page Designing
Journalism: Guidelines and Steps in Page Designing Journalism: Guidelines and Steps in Page Designing
Journalism: Guidelines and Steps in Page Designing
Jamaica Olazo
 
MATERI AQIDAH Mengurai Sombong
MATERI AQIDAH Mengurai SombongMATERI AQIDAH Mengurai Sombong
MATERI AQIDAH Mengurai Sombong
Anas Wibowo
 
successful entrepreneurs of flipkart {sachin and binny bansal}
successful entrepreneurs of flipkart {sachin and binny bansal} successful entrepreneurs of flipkart {sachin and binny bansal}
successful entrepreneurs of flipkart {sachin and binny bansal}
Yogesh Gokule
 
leanIX - Networking Event Hamburg 22.2.2013
leanIX - Networking Event Hamburg 22.2.2013leanIX - Networking Event Hamburg 22.2.2013
leanIX - Networking Event Hamburg 22.2.2013
LeanIX GmbH
 

Viewers also liked (18)

如何滅除痛苦
如何滅除痛苦如何滅除痛苦
如何滅除痛苦
 
Web search-metrics-tutorial-www2010-section-6of7-freshness
Web search-metrics-tutorial-www2010-section-6of7-freshnessWeb search-metrics-tutorial-www2010-section-6of7-freshness
Web search-metrics-tutorial-www2010-section-6of7-freshness
 
Flasirana voda
Flasirana vodaFlasirana voda
Flasirana voda
 
ETSY GUY FINAL
ETSY GUY FINALETSY GUY FINAL
ETSY GUY FINAL
 
Buyer presentation
Buyer presentationBuyer presentation
Buyer presentation
 
Jsf 2
Jsf 2Jsf 2
Jsf 2
 
Lutein plus
Lutein plusLutein plus
Lutein plus
 
20160821 a parábola do semeador
20160821 a parábola do semeador20160821 a parábola do semeador
20160821 a parábola do semeador
 
Spirulina chlorella plus
Spirulina chlorella plusSpirulina chlorella plus
Spirulina chlorella plus
 
Pseudo-addiction
Pseudo-addictionPseudo-addiction
Pseudo-addiction
 
Zvit-vihovna
Zvit-vihovnaZvit-vihovna
Zvit-vihovna
 
Differently-abled Heroes of India; awarded by Limca book of records
Differently-abled Heroes of India; awarded by Limca book of recordsDifferently-abled Heroes of India; awarded by Limca book of records
Differently-abled Heroes of India; awarded by Limca book of records
 
Essential skills of a teacher
Essential skills of a teacherEssential skills of a teacher
Essential skills of a teacher
 
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
Harvard Business School: Why Companies Fail and How Their Founders Can Bounce...
 
Journalism: Guidelines and Steps in Page Designing
Journalism: Guidelines and Steps in Page Designing Journalism: Guidelines and Steps in Page Designing
Journalism: Guidelines and Steps in Page Designing
 
MATERI AQIDAH Mengurai Sombong
MATERI AQIDAH Mengurai SombongMATERI AQIDAH Mengurai Sombong
MATERI AQIDAH Mengurai Sombong
 
successful entrepreneurs of flipkart {sachin and binny bansal}
successful entrepreneurs of flipkart {sachin and binny bansal} successful entrepreneurs of flipkart {sachin and binny bansal}
successful entrepreneurs of flipkart {sachin and binny bansal}
 
leanIX - Networking Event Hamburg 22.2.2013
leanIX - Networking Event Hamburg 22.2.2013leanIX - Networking Event Hamburg 22.2.2013
leanIX - Networking Event Hamburg 22.2.2013
 

Similar to Apache kafka

Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
Srikrishna k
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
TarekHamdi8
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and Zookeeper
AnandMHadoop
 
kafka_session_updated.pptx
kafka_session_updated.pptxkafka_session_updated.pptx
kafka_session_updated.pptx
Koiuyt1
 
Apache kafka
Apache kafkaApache kafka
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Shameera Rathnayaka
 
SA UNIT II KAFKA.pdf
SA UNIT II KAFKA.pdfSA UNIT II KAFKA.pdf
SA UNIT II KAFKA.pdf
ManjuAppukuttan2
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
natashasweety7
 
A Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka SkillsA Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka Skills
Ravindra kumar
 
Kafka Overview
Kafka OverviewKafka Overview
Kafka Overview
iamtodor
 
Kafka RealTime Streaming
Kafka RealTime StreamingKafka RealTime Streaming
Kafka RealTime Streaming
Viyaan Jhiingade
 
Kafka Deep Dive
Kafka Deep DiveKafka Deep Dive
Kafka Deep Dive
Knoldus Inc.
 
Kafka Fundamentals
Kafka FundamentalsKafka Fundamentals
Kafka Fundamentals
Ketan Keshri
 
Introduction to Kafka Streams Presentation
Introduction to Kafka Streams PresentationIntroduction to Kafka Streams Presentation
Introduction to Kafka Streams Presentation
Knoldus Inc.
 
Kafka 10000 feet view
Kafka 10000 feet viewKafka 10000 feet view
Kafka 10000 feet view
younessx01
 
Intoduction to Apache Kafka
Intoduction to Apache KafkaIntoduction to Apache Kafka
Intoduction to Apache Kafka
Veysel Gündüzalp
 
Introduction_to_Kafka - A brief Overview.pdf
Introduction_to_Kafka - A brief Overview.pdfIntroduction_to_Kafka - A brief Overview.pdf
Introduction_to_Kafka - A brief Overview.pdf
ssuserc49ec4
 
ActiveMQ interview Questions and Answers
ActiveMQ interview Questions and AnswersActiveMQ interview Questions and Answers
ActiveMQ interview Questions and Answers
jeetendra mandal
 
Columbus mule soft_meetup_aug2021_Kafka_Integration
Columbus mule soft_meetup_aug2021_Kafka_IntegrationColumbus mule soft_meetup_aug2021_Kafka_Integration
Columbus mule soft_meetup_aug2021_Kafka_Integration
MuleSoft Meetup
 
Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-Camus
Deep Shah
 

Similar to Apache kafka (20)

Kafka tutorial
Kafka tutorialKafka tutorial
Kafka tutorial
 
apachekafka-160907180205.pdf
apachekafka-160907180205.pdfapachekafka-160907180205.pdf
apachekafka-160907180205.pdf
 
Session 23 - Kafka and Zookeeper
Session 23 - Kafka and ZookeeperSession 23 - Kafka and Zookeeper
Session 23 - Kafka and Zookeeper
 
kafka_session_updated.pptx
kafka_session_updated.pptxkafka_session_updated.pptx
kafka_session_updated.pptx
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQCluster_Performance_Apache_Kafak_vs_RabbitMQ
Cluster_Performance_Apache_Kafak_vs_RabbitMQ
 
SA UNIT II KAFKA.pdf
SA UNIT II KAFKA.pdfSA UNIT II KAFKA.pdf
SA UNIT II KAFKA.pdf
 
Apache kafka
Apache kafkaApache kafka
Apache kafka
 
A Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka SkillsA Quick Guide to Refresh Kafka Skills
A Quick Guide to Refresh Kafka Skills
 
Kafka Overview
Kafka OverviewKafka Overview
Kafka Overview
 
Kafka RealTime Streaming
Kafka RealTime StreamingKafka RealTime Streaming
Kafka RealTime Streaming
 
Kafka Deep Dive
Kafka Deep DiveKafka Deep Dive
Kafka Deep Dive
 
Kafka Fundamentals
Kafka FundamentalsKafka Fundamentals
Kafka Fundamentals
 
Introduction to Kafka Streams Presentation
Introduction to Kafka Streams PresentationIntroduction to Kafka Streams Presentation
Introduction to Kafka Streams Presentation
 
Kafka 10000 feet view
Kafka 10000 feet viewKafka 10000 feet view
Kafka 10000 feet view
 
Intoduction to Apache Kafka
Intoduction to Apache KafkaIntoduction to Apache Kafka
Intoduction to Apache Kafka
 
Introduction_to_Kafka - A brief Overview.pdf
Introduction_to_Kafka - A brief Overview.pdfIntroduction_to_Kafka - A brief Overview.pdf
Introduction_to_Kafka - A brief Overview.pdf
 
ActiveMQ interview Questions and Answers
ActiveMQ interview Questions and AnswersActiveMQ interview Questions and Answers
ActiveMQ interview Questions and Answers
 
Columbus mule soft_meetup_aug2021_Kafka_Integration
Columbus mule soft_meetup_aug2021_Kafka_IntegrationColumbus mule soft_meetup_aug2021_Kafka_Integration
Columbus mule soft_meetup_aug2021_Kafka_Integration
 
Copy of Kafka-Camus
Copy of Kafka-CamusCopy of Kafka-Camus
Copy of Kafka-Camus
 

More from Ramakrishna kapa

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
Ramakrishna kapa
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
Ramakrishna kapa
 
Batch processing
Batch processingBatch processing
Batch processing
Ramakrishna kapa
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
Ramakrishna kapa
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
Ramakrishna kapa
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
Ramakrishna kapa
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
Ramakrishna kapa
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
Ramakrishna kapa
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
Ramakrishna kapa
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
Ramakrishna kapa
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
Ramakrishna kapa
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
Ramakrishna kapa
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
Ramakrishna kapa
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
Ramakrishna kapa
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
Ramakrishna kapa
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
Ramakrishna kapa
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
Ramakrishna kapa
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
Ramakrishna kapa
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
Ramakrishna kapa
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
Ramakrishna kapa
 

More from Ramakrishna kapa (20)

Load balancer in mule
Load balancer in muleLoad balancer in mule
Load balancer in mule
 
Anypoint connectors
Anypoint connectorsAnypoint connectors
Anypoint connectors
 
Batch processing
Batch processingBatch processing
Batch processing
 
Msmq connectivity
Msmq connectivityMsmq connectivity
Msmq connectivity
 
Scopes in mule
Scopes in muleScopes in mule
Scopes in mule
 
Data weave more operations
Data weave more operationsData weave more operations
Data weave more operations
 
Basic math operations using dataweave
Basic math operations using dataweaveBasic math operations using dataweave
Basic math operations using dataweave
 
Dataweave types operators
Dataweave types operatorsDataweave types operators
Dataweave types operators
 
Operators in mule dataweave
Operators in mule dataweaveOperators in mule dataweave
Operators in mule dataweave
 
Data weave in mule
Data weave in muleData weave in mule
Data weave in mule
 
Servicenow connector
Servicenow connectorServicenow connector
Servicenow connector
 
Introduction to testing mule
Introduction to testing muleIntroduction to testing mule
Introduction to testing mule
 
Choice flow control
Choice flow controlChoice flow control
Choice flow control
 
Message enricher example
Message enricher exampleMessage enricher example
Message enricher example
 
Mule exception strategies
Mule exception strategiesMule exception strategies
Mule exception strategies
 
Anypoint connector basics
Anypoint connector basicsAnypoint connector basics
Anypoint connector basics
 
Mule global elements
Mule global elementsMule global elements
Mule global elements
 
Mule message structure and varibles scopes
Mule message structure and varibles scopesMule message structure and varibles scopes
Mule message structure and varibles scopes
 
How to create an api in mule
How to create an api in muleHow to create an api in mule
How to create an api in mule
 
Log4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexibleLog4j is a reliable, fast and flexible
Log4j is a reliable, fast and flexible
 

Recently uploaded

"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
Fwdays
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Alliance
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
DianaGray10
 
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceCracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Quentin Reul
 
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan..."Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
Fwdays
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - HealeniumSelf-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
Knoldus Inc.
 
Keynote : AI & Future Of Offensive Security
Keynote : AI & Future Of Offensive SecurityKeynote : AI & Future Of Offensive Security
Keynote : AI & Future Of Offensive Security
Priyanka Aash
 
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdfDefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
Yury Chemerkin
 
Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
ZachWylie3
 
Demystifying Neural Networks And Building Cybersecurity Applications
Demystifying Neural Networks And Building Cybersecurity ApplicationsDemystifying Neural Networks And Building Cybersecurity Applications
Demystifying Neural Networks And Building Cybersecurity Applications
Priyanka Aash
 
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI CertificationTrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
Priyanka Aash
 
Enterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdfEnterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdf
Yury Chemerkin
 
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Snarky Security
 
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptxFIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Alliance
 
The History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal EmbeddingsThe History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal Embeddings
Zilliz
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
Razin Mustafiz
 
Indian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for StartupsIndian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for Startups
AMol NAik
 
NVIDIA at Breakthrough Discuss for Space Exploration
NVIDIA at Breakthrough Discuss for Space ExplorationNVIDIA at Breakthrough Discuss for Space Exploration
NVIDIA at Breakthrough Discuss for Space Exploration
Alison B. Lowndes
 
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptxFIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
FIDO Alliance
 

Recently uploaded (20)

"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
"Hands-on development experience using wasm Blazor", Furdak Vladyslav.pptx
 
FIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptxFIDO Munich Seminar FIDO Automotive Apps.pptx
FIDO Munich Seminar FIDO Automotive Apps.pptx
 
How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...How UiPath Discovery Suite supports identification of Agentic Process Automat...
How UiPath Discovery Suite supports identification of Agentic Process Automat...
 
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise ExcellenceCracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
Cracking AI Black Box - Strategies for Customer-centric Enterprise Excellence
 
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan..."Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
"Building Future-Ready Apps with .NET 8 and Azure Serverless Ecosystem", Stan...
 
Self-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - HealeniumSelf-Healing Test Automation Framework - Healenium
Self-Healing Test Automation Framework - Healenium
 
Keynote : AI & Future Of Offensive Security
Keynote : AI & Future Of Offensive SecurityKeynote : AI & Future Of Offensive Security
Keynote : AI & Future Of Offensive Security
 
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdfDefCamp_2016_Chemerkin_Yury_--_publish.pdf
DefCamp_2016_Chemerkin_Yury_--_publish.pdf
 
Camunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptxCamunda Chapter NY Meetup July 2024.pptx
Camunda Chapter NY Meetup July 2024.pptx
 
Demystifying Neural Networks And Building Cybersecurity Applications
Demystifying Neural Networks And Building Cybersecurity ApplicationsDemystifying Neural Networks And Building Cybersecurity Applications
Demystifying Neural Networks And Building Cybersecurity Applications
 
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI CertificationTrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
TrustArc Webinar - Innovating with TRUSTe Responsible AI Certification
 
Finetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and DefendingFinetuning GenAI For Hacking and Defending
Finetuning GenAI For Hacking and Defending
 
Enterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdfEnterprise_Mobile_Security_Forum_2013.pdf
Enterprise_Mobile_Security_Forum_2013.pdf
 
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
Welcome to Cyberbiosecurity. Because regular cybersecurity wasn't complicated...
 
FIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptxFIDO Munich Seminar: FIDO Tech Principles.pptx
FIDO Munich Seminar: FIDO Tech Principles.pptx
 
The History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal EmbeddingsThe History of Embeddings & Multimodal Embeddings
The History of Embeddings & Multimodal Embeddings
 
The Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - CoatueThe Path to General-Purpose Robots - Coatue
The Path to General-Purpose Robots - Coatue
 
Indian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for StartupsIndian Privacy law & Infosec for Startups
Indian Privacy law & Infosec for Startups
 
NVIDIA at Breakthrough Discuss for Space Exploration
NVIDIA at Breakthrough Discuss for Space ExplorationNVIDIA at Breakthrough Discuss for Space Exploration
NVIDIA at Breakthrough Discuss for Space Exploration
 
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptxFIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
FIDO Munich Seminar: Strong Workforce Authn Push & Pull Factors.pptx
 

Apache kafka

  • 1. Apache Kafka is a fast, scalable, durable and distributed messaging system.
  • 2.   We need basic Java programming skills plus access to:  Apache Kafka 0.9.0  Apache Maven 3.0 or later  Git  Step 1: Download Kafka Download the Apache Kafka 0.9.0release and un-tar it. Prerequisites & Installation
  • 3.  Kafka is designed for distributed high throughput systems. Kafka tends to work very well as a replacement for a more traditional message broker. In comparison to other messaging systems, Kafka has better throughput, built-in partitioning, replication and inherent fault-tolerance, which makes it a good fit for large-scale message processing applications. 
  • 4.   A Messaging System is responsible for transferring data from one application to another, so the applications can focus on data, but not worry about how to share it. Distributed messaging is based on the concept of reliable message queuing. Messages are queued asynchronously between client applications and messaging system. Two types of messaging patterns are available − one is point to point and the other is publish-subscribe (pub-sub) messaging system. Most of the messaging patterns follow pub-sub. What is a Messaging System?
  • 5.   In a point-to-point system, messages are persisted in a queue. One or more consumers can consume the messages in the queue, but a particular message can be consumed by a maximum of one consumer only. Once a consumer reads a message in the queue, it disappears from that queue. The typical example of this system is an Order Processing System, where each order will be processed by one Order Processor, but Multiple Order Processors can work as well at the same time. The following diagram depicts the structure. Point to Point Messaging System Sender Message Queue Receiver
  • 6.  In the publish-subscribe system, messages are persisted in a topic. Unlike point-to-point system, consumers can subscribe to one or more topic and consume all the messages in that topic. In the Publish-Subscribe system, message producers are called publishers and message consumers are called subscribers. A real-life example is Dish TV, which publishes different channels like sports, movies, music, etc., and anyone can subscribe to their own set of channels and get them whenever their subscribed channels are available. Publish-Subscribe Messaging System Sender Message Queue Receiver Receiver Receiver
  • 7.   Following are a few benefits of Kafka −  Reliability − Kafka is distributed, partitioned, replicated and fault tolerance.  Scalability − Kafka messaging system scales easily without down time..  Durability − Kafka uses Distributed commit log which means messages persists on disk as fast as possible, hence it is durable..  Performance − Kafka has high throughput for both publishing and subscribing messages. It maintains stable performance even many TB of messages are stored.  Kafka is very fast and guarantees zero downtime and zero data loss. Benefits
  • 8.   Kafka is a unified platform for handling all the real-time data feeds. Kafka supports low latency message delivery and gives guarantee for fault tolerance in the presence of machine failures. It has the ability to handle a large number of diverse consumers. Kafka is very fast, performs 2 million writes/sec. Kafka persists all data to the disk, which essentially means that all the writes go to the page cache of the OS (RAM). This makes it very efficient to transfer data from page cache to a network socket.  Need for Kafka
  • 9.   such as topics, brokers, producers and consumers.  Topics: A stream of messages belonging to a particular category is called a topic. Data is stored in topics  Partition:Topics may have many partitions, so it can handle an arbitrary amount of data.  Partition offset: Each partitioned message has a unique sequence id called as offset  Replicas of partition: Replicas are nothing but backups of a partition. Replicas are never read or write data. They are used to prevent data loss.  Brokers  Brokers are simple system responsible for maintaining the pub-lished data. Each broker may have zero or more partitions per topic. Assume, if there are N partitions in a topic and N number of brokers, each broker will have one partition. Kafka main terminologies
  • 10.   The sample Producer is a classical Java application with a main() method, this application must:  Initialize and configure a producer  Use the producer to send messages  1- Producer Initialization Create a producer is quite simple, you just need to create an instance of the org.apache.kafka.clients.producer.KafkaProducer class with a set of properties, this looks like:  producer = new KafkaProducer(properties); In this example, the configuration is externalized in a property file, with the following entries: Producer
  • 11.   Once you have a producer instance you can post messages to a topic using the ProducerRecord class. The ProducerRecord class is a key/value pair where:  the key is the topic  the value is the message  As you can guess sending a message to the topic is straight forward:  ... producer.send(new ProducerRecord("fast-messages", "This is a dummy message")); ... 2- Message posting
  • 12.  Once you are done with the producer use the producer.close() method that blocks the process until all the messages are sent to the server. This call is used in a finally block to guarantee that it is called. A Kafka producer can also be used in a try with resources construct.  ... }  finally { producer.close();  } Producer End
  • 13.   The Consumer class, like the producer is a simple Java class with a main method.  This sample consumer uses the Hdr Histogram library to record and analyze the messages received from the fast-messages topic, and Jackson to parse JSON messages. Consumer
  • 14.   ZooKeeper is used for managing and coordinating Kafka broker. ZooKeeper service is mainly used to notify producer and consumer about the presence of any new broker in the Kafka system or failure of the broker in the Kafka system. As per the notification received by the Zookeeper regarding presence or failure of the broker then pro-ducer and consumer takes decision and starts coordinating their task with some other broker.  Kafka stores basic metadata in Zookeeper such as information about topics, brokers, consumer offsets (queue readers) and so on. ZooKeeper