During the next few lectures, we will create a topic that will have several politicians and we will
explore what Kafka will do basically on the broadcast and how log files will be created in the DMP directory.
So let's get started and ensure that you have both sides of the file somewhere on your computer.
And I have opened it in notepad.
So I thought what we need to do is to start a keeper and start Kafka.
In this case, that we will start just single zookeeper and a single broker with default configuration
of files.
That's why we will use the doors commands without any changes.
And afterwards we will create a new topic with three partitions.
And the topic name will be, let's say, animals.
And you could adjust this commander in a notepad as well.
And after creation of the topic, we will launch a built in Kafka console producer and Kafka console
consumer and we'll try to send several messages and observe where they will land.
Finally at the producer.
So let's get started and let's first start as people please notice that in this section, for every
separate task, I'll use Gleen Kafka installation in order to avoid some misunderstanding of Kafka logs.
So I'll just unzip every time Kafka installation of files and that's it.
And in my case, this folder, Kafka folder is located in front of you as our directory.
And here I have all the files.
OK, so let's get started and let's first launch a zookeeper.
I'll cope with this comment and based simply here.
OK, zookeeper is up and running.
No, let me open up new tab here in our terminal.
And please ensure that you'll see dear to Kafka for Dragon, said COFCO.
And no, let me copy this command that will start Kafka, Broadcom and based it here.
And Casanova with ID zero was successful, it launched Great, now let's agree, the topic was named
Animals.
And for that, let me open up again one more time here again to Kafka Fooldom.
Let's clear Tamino and move to creation of the topic.
Come on this one again.
Notice that I was here everywhere I backslash and it is just separate between the different parts of
the same command.
So let me select this entire command like soul and based it here.
Wonderful command was executed successfully, and now let's verify what the Kafka broker actually did
in the Dead Logs folder, where all messages, all logs will be actually stored.
I'll do that in this time.
No window.
So let me do around here and now to slash DMP, slash Kafka desk logs and ensure that you'll at last
and no less list files here.
And notice that there are three new folders, animals, Desh, zero animals, D1, one animals in the
store.
And now it's fully clear to you why we now here three folders.
I have explained that to you in a previous section.
That's because we have specified that we want to have three partitions.
And for this reason, Kafka broker has created three folders for every separate partition.
Notice also that at the moment we are on only a single broker.
This way.
All three folders were created on a same brolga in the same Kafka logs folder.
If I go into any of those folders now, let's send to animals, for example, one and list files here
and the contents of a log file.
This one I'll see basically empty file.
That's because we haven't yet produced any messages to this animal.
Storbeck Wonderful.
Let me see one level up here and let's leave this step open to we will get back to it a bit later when
will produce some messages to this topic.
So let me just clear time and I like so and let me open up new tab here and let's not start the console
producer.
So let me go back to these documents, find the command that starts the console producer here.
Notice and notice that I need to change the topic test and replace it with animals like so because I
want to produce messages to animals topic.
So let me select this command, go back to this terminal window to Kafka folder.
Notice that you need to do that again and again when you open up new terminal window and now paste command
here.
Great, and now I am able to produce some messages to this topic and let's produce some, for example,
cat, dog like monkey.
And that's it.
Now let's open up a Kafka console consumer and try to consume those messages.
Let me go back again to a list of commands, and we will consume messages from beginning.
And the topic will be animals.
So let me replace test with animals here and let me select entire command and go back here.
Open up again.
New Tab Sedita COFCO.
And based corporate command like Soul Antrel.
And I have successfully received all three messages, monarchy, cat and dog.
Now we have a run stopper and we have agreed to successfully a topic with three politicians.
Let's not make a short pause.
And after it, let's explore what was actually in Kafka logs directory and where Kafka Brolga has saved
those three messages that we co-produced by council producer.
So see you after the small balls by.