We have just created the topic called animals, and we have specified that we want to create three partitions
for this topic and we have produced using a built in console producer of several months just in this
order, get Doug and Monarchism and was hoping for a built in console consumer.
We have consumed those messages and we have specified the desk from beginning option.
That means that we wanted to retrieve messages from the very first offset.
But you may have noticed that the console consumer has consumed messages not in the same order.
We have produced those messages.
So here order is monarchy, cat and dog, and we have produced messages in this order.
Get dog and monkey.
Please notice that on your computer you may see all the order that is different from mine.
And the reason for that is that we have created the topic with several partitions and now every consumer
that will connect to Animal Storbeck will read messages from multiple partitions and that is not necessary,
that it will read in a round robin fashion starting from Proposition zero, then partition one, partition
two.
It may read in different order.
That's why messages might arrive here also in a different order.
But no.
Let's explore what was changed in a Kafka logs folder and how messages were stored in the logs, folders,
I mean folders, gold, animals, zero animals, one and animals to notice that the Kafka has again
automatically created the consumer offsets topic with fifty partitions.
OK, let's explore the contents of those folders.
But for simplicity, let me open up Kafka logs folder in visual studio cold storage files more cuica.
Well let me go one level up like Soul and open DMP a folder in finder in my case for that I can simply
type open command.
This command in Unix like systems will simply open up this folder on windows.
Please accept that you have a modified location of the Kafka logs folder and you should navigate there
manually.
So now I'll open up this before they're like so and I'll simply drag Kafka.
This logs folder into visual studio called Application.
It is up and running.
In my case.
If you have not yet open it, please open it up.
So I'll drag this folder here like so.
And now this folder with all of the folders has successfully opened here in the U.S. court.
So let me expand Animals Zero folder and I'm interested in a log file this one.
And you may notice that Vasco doesn't want to open this file because it is either binary or user's unsupported
text encoding.
But let me open it anyway by clicking on this question like SOL and after opening it up, let me broski
combination ild option slike.
So that will wrap up long lines and remove horizontal scrolling.
And here in this file I'll see text Mongu and that means that message with text Munky was stored in
animals desk zero folder enthralls partyism.
Let me do the same with the animals, this one folder, but before doing that, let me double click
on the headline of this file to keep it here in the studio code.
So let me expand Animals Desk one folder and double click on this file.
Same as before.
Click here, open it anyway and wrap it up.
Using a key combination of Option Z and I see here message.
And finally, let's have a look at log file in the last folder in the lost partition.
Again, double click it and open it anyway or option Z.
And here I sit next can.
And that means that all three messages were spread equally among all three partitions.
In my case it was stored in animals to a folder.
Next, the dog was stored in animals, this one for the second partition and the text monarchy was stored
in a thrust partition.
And now question to you, which of set numbers have messages in each partition?
You are right, every message in my case has upset number zero, because, as you may remember from
the previous section of that number must be unique across every politician.
At the moment, we have just a single message in every politician, and that's why every of those messages
have offset number zero and we will prove it in one of the next elections.
Now, let me go back to Kafka, console consumer and again, order in which we have received those messages
so throws the game Munky next get and finally does.
And if I go back to this output I'll see that market was thought in my case and partition zero next
dog was thought in second position and finally Cat was thought in the last partition.
So order across partitions is monarch, dog and cat.
But here it was received in order monarch, cat and dog.
And that means that Kafka Cuonzo consumer has read in my case, Thrillist Competition zero next for
competition two and finally for competition one again.
In your case, this order may be completely different and distribution of messages here across different
log files may be also different as well.
And in my case, Kafka also producer has Redl message Massachusett to last Patison with.
Added to next comes message dog that was written to partition with one here it this and finally monarchy
was written to the fourth partition with zero and here you see proof of that wonderful.
No let's try to do falling.
Let's try to read by console consumer messages from specific partition, for example, let's say from
partition with a one.
But let's try that in the next lecture.
Bye bye.