We have just explored how are we able to read messages from specific partition and notice that you could
do the same, not using just built in the console consumer, you are able to use any of our consumer
and do the same or read messages from a particular partition.
Let's not try to produce one more message that we have produced only three messages in this order.
Let me add, for example, message rebundle like so if you have stopped the console producer, please
start over again and produce one more message, OK?
This message was sent.
And now let's first explore where this message was stored.
I mean, in which partition.
Let me go back to Visual Studio Code and let's try to read again every log file.
And I immediately see that my case, this message was stored in the same partition where my dog was
stored, and that is a partition with a deep one.
In my case, it is second partition.
And if I try to read no messages from the second partition, I should see two messages, Doug and Bonda.
And here I can run the same command as in a previous election.
But with partition.
No, to let me terminate this comment.
And here in a history I have a comment where I have read messages from partition with one.
So let's run it again.
And now I see two messages, dog and Panda, in your case, you should read the competition where you
see actually two massages instead of one.
Wonderful, no, let's try to read massages from specific partyism using a particular offset starting
offset, because here in this comment, we read messages from beginning from the very first offset from
upset number zero.
So let's go to notepad here and let's adjust this comment and add one more option offset.
So let me again copy it up like soul.
Pasted below and here, I'll read message from specific offset.
I'll remove all this dust from beginning and instead of it, I'll add here option offset and I'll throw
it if I zero as a starting of set number and I'll read from protection number one.
So let me copy this comment.
Terminate this one time terminal based command.
So, again, I read messages in topic animals in position number one, and the offset will be zero starting
offset anther.
And I should see two messages.
And yes, here they are.
Now, let's try to read the messages starting from offset number one.
So let me go back to the previous comment.
And that just upset number one like.
So let's run it.
And I have got only a single message, and that is, of course, Bonda, because Bonda has arrived after
dark and that's why it has got upset, number one, because as you already know, the most important
concept is that every message has unique offset, no growth partition.
And in our case, Doug has offset number zero and Bonda has offset number one.
No, if I try to read messages from offset number two like so, I should get an output, of course.
So less executed.
And as expected, I got nothing wonderful, let's terminate this comment and don't let's try to read
Martha just starting from of set number one for all politicians, not just practical opposition for
that look, again, copied this entire command with a description pasted below.
And no, I would like to read messages from specific offset generally, not just from specific protection.
So let me remove this and remove this line like so.
And now I would like to read messages from offset number one.
Let me copy this comment.
And before based on it, please try to answer yourself how many messages now we should get after execution
of this command list provided.
So Command Corbitt bit clear and and based command here again here we will read all messages from topic
animals starting from upset number one antonym.
And we got an arrow looking scroll up and the here at the beginning of this output, we see the partition
is required when offset is specified.
That means that you are not able to read from all partitions, starting from a particular offset.
You must specify a partition number if you want to start from particular offset.
And that's pretty reasonable.
That's the way it.
Let me go back to Notepad and delete this comment in Kafka.
It is not possible to read from a specific offset generally across an entire topic.
You must specify partition number, as we did here in a previous comment.
Let's run this comment once again and try to read messages from partition with it to let's copy this
command, go here, clear terminal based command and I should get a single message.
It is getting my case now.
I don't get any error because now we are reading from a particular partition, starting from a particular
offset.
No, you know how to read messages from all partitions, from a particular partition and from particular
partition starting from particular offset.
There was one more thing left I wanted to demonstrate to here in this example with multiple partitions.
And that's how you are able to read the details about a particular topic.
So let's do that in the next lecture by by.