It aims to provide a unified, high-throughput, low-latency platform for handling real-time data feeds. Kafka provides reliable, millisecond responses to support both customer-facing applications and connecting downstream systems with real-time data.
Niles Partners is launching a product which will configure and publish Apache Kafka, to produce free implementations of distributed or otherwise scalable and high availability which is embedded pre-configured tool with Ubuntu and ready-to-launch VM on Azure that contains Hadoop, Hbase and Apache Kafka.
Before going into deep, one must learn that whatever we are using, what good it stands for?
And to understand this, we have two applications that are as follows:
Building real-time streaming data pipelines that reliably get data between systems or applications
Building real-time streaming applications that transform or react to the streams of data
It is one of the most popular tool among the developers around the world as it is easy to pick up and such a platform with 4APIs namely Producer, Consumer, Streams, and Connect.
The Producer API allows an application to publish a stream of records to one or more Kafka topics.
The Consumer API allows an application to subscribe to one or more topics and process the stream of records produced to them.
The Streams API allows an application to act as a stream processor, consuming an input stream from one or more topics and producing an output stream to one or more output topics, effectively transforming the input streams to output streams.
The Connector API allows building and running reusable producers or consumers that connect Kafka topics to existing applications or data systems. For example, a connector to a relational database might capture every change to a table.
Without having the basic knowledge, one cannot deeply understand its nature and how it works. For that we should understand a few basic concepts about Apache Kafka:
Kafka run as a cluster on one or more servers.
The Kafka cluster stores streams of records in categories called topics.
Each record consists of a key, a value, and a timestamp.
Topics and Logs
Let’s first dive into the core abstraction Kafka provides for a stream of records—The topic.
A topic is a category or feed name to which records are published. Topics in Kafka are always multi-subscriber; that is, a topic can have zero, one, or many consumers that subscribe to the data written to it.
Kafka stores messages which come from arbitrarily many processes called “producers”. The data can thereby be partitioned in different “partitions” within different “topics”. Within a partition the messages are indexed and stored together with a timestamp.
Other processes called “consumers” can query messages from partitions. Kafka runs on a cluster of one or more servers and the partitions can be distributed across cluster nodes.
Apache Kafka efficiently processes the real-time and streaming data when implemented along with Apache Storm, Apache HBase and Apache Spark. Deployed as a cluster on multiple servers, Kafka handles its entire publish and subscribe messaging system with the help of four APIs, namely, producer API, consumer API, streams API and connector API. Its ability to deliver massive streams of message in a fault-tolerant fashion has made it replace some of the conventional messaging systems like JMS, AMQP, etc.
It will take a few minutes for your VM to be deployed. When the deployment is finished, move on to the next section.
Connect to virtual machine
Create an SSH connection with the VM.
bashCopy
ssh azureuser@10.111.12.123
Usage/Deployment Instruction
Step 1: Access Kafka from Azure Marketplace and click ON Get it now button.
Click on Continue then on Create,
Step 2:Now to create a virtual machine, enter or select appropriate values for zone, machine type, resource group and so on as per your choice.
Click on Create;
Usage and Deployment Instruction:
Step 1: Open Putty for SSH
Step 2: Open Putty and Type <instance public IP> at “Host Name”
Step 3: Open Connection->SSH->Auth tab from Left Side Area
Step 4: Click on browse button and select ppk file for Instance and then click on Open
Step 5: Type “ubuntu” as user name Password auto taken from PPK file
Step 5.1: If you get any update option from Ubuntu, then you have to follow the following steps:
After then follow the following commands
$ apt-get update
$ apt-get upgrade
$ sudo su
$ cd kafka_2.13-2.8.0
Step 6: Use following Linux command to Start Kafka and Zookeeper
STEP 7: START THE KAFKA ENVIRONMENT
#Start the ZooKeeper service
zookeeper-server-start.sh config/zookeeper.properties
Open another terminal session and run:
#Start the kafka broker service.
kafka-server-start.sh config/server.properties
Once all services have successfully launched, you will have a basic Kafka environment running and ready to use.
So before you can write your first events, you must create a topic. Open another terminal session and run:
bin/kafka-topics.sh –create –topic quickstart-events –bootstrap-server localhost:9092
bin/kafka-console-producer.sh –topic quickstart-events –bootstrap-server localhost:9092
Open another terminal session and run the console consumer client to read the events you just created:
bin/kafka-console-consumer.sh –topic quickstart-events –from-beginning –bootstrap-server localhost:9092
If you write a new message using the Producer API, it should also be displayed instantly on the Consumer side as shown in the screenshot below.