We have just observed the tails of our new topic month, and we have seen that each politician now has
three different replicas and one of those replicas is actually leader for every politician, no less
Stratolaunch producer and consumer and the producer massages.
And first, let's launch consumer.
Let's take this comment.
Open up new tab, let's keep this step open, because we will get back to this command later on when
we will try to bring down one of the brokers.
So let's open up new untapped gold, took off scaffolders usually and start consumer.
Consumer will start let's open up New LDAP City to Kafka again, let's take command that will launch
producer copied and paste here.
OK, my producer is running and now let's produce some messages to our topic month, and you might guess
that I'll write the names of demands.
So first months will be January.
Next one, February.
March.
April.
June.
July.
August.
OK, it's enough, let's go now to consumer and verify whether it has received all those messages or
not.
So let's go there.
And yes, here we see old messages from January to August.
And notice that now we see actually the same order of the messages that we have produced here on producer.
And the reason for that is simple.
We have produced those messages one by one consumer was already running, was started before, and that's
why it has received all those messages also one by one in the same order as they were produced here.
But now let's quickly try to stop this consumer and try to start it over again with option from beginning
and to observe whether we will get same order or not.
We'll stop it.
Go to our magic file and let's select this command that will read messages from Beginning Topic Month.
Copy it.
Clear terminal here.
Based Command after.
And now, as expected, I got a completely different order of those massages, and again, the reason
for that is that producer has written those messages to different politicians, not particularly in
the Round-Robin fashion statement from the politician with a zero.
So order is completely mixed.
And that's why here on the consumer side, I got Aude also mixed.
Great.
Let's now produce one or two messages additionally to those.
So September.
October.
November.
So let's type all month and December, wonderful, 12 months just produced, and if I get here back
to consumer, I see messages starting from September in the same order as they were produced by producer.
And again, the reason for that is that the consumer was already running while we were producing those
messages by producer, and that's why it was receiving them one by one.
It seems that I have forgotten Makia.
Sorry for that.
So only 11 messages were produced.
Let's add me here after December.
Sorry for that.
Great and May has appeared here at the end of the list at consumer site.
Let's not quickly stop this consumer and let's try to read from particular partition.
So let's stop it.
Go to our file with comments and let me select this comment based here.
And now I'll start consumer and with messages from specific.
Partizan.
And here will be, let's say, partition.
Let's say we say the three bucks here and from beginning.
OK, let's copy this comment.
Clear terminal and based here.
And now I get only three messages in my case.
January, April and August, in your case, you will get completely different messages because in your
case, messages will be spread across different partitions in a completely different way.
Let's try to read from us repartition.
So let me stop this and let's change partition number two, let's say six.
Remember that in total we have seven partitions starting from zero.
Also lost.
One will be with 86.
Let me copy it based here.
And now I receive only two messages.
July and November, let's also quickly try to add offset option instead of from beginning to end this
comment.
Well, let's go back here.
Let me quickly go up into entire comment.
Based here below, so start from specific protection and and specific of set and here instead of from
beginning will be.
Offset, let's say one.
And let me read from Partition with ID3, because this partition in my case has three messages and I
want to start from offset with number one.
And I should get the two messages, April and August.
So let me select this command in your case, please select partition that has at least two messages.
So let me copy this command.
Terminate this based.
And yes, I got only two messages, April and August, if I change of said to do in my case again,
because I have three messages here in this petition, I could get only last one August.
Yes.
Here it is.
Wonderful.
Let us know.
Also, quickly go back to log's for those where old messages are stored actually on each of the brokers
and the lists, observe the contents of the partition with ID3, but let's go.
One is usually after the small balls.
So see you next.
Bye bye.