WEBVTT 00:04.560 --> 00:10.620 We have just explored how are we able to read messages from specific partition and notice that you could 00:10.620 --> 00:16.740 do the same, not using just built in the console consumer, you are able to use any of our consumer 00:16.740 --> 00:20.290 and do the same or read messages from a particular partition. 00:20.940 --> 00:27.520 Let's not try to produce one more message that we have produced only three messages in this order. 00:27.840 --> 00:33.990 Let me add, for example, message rebundle like so if you have stopped the console producer, please 00:33.990 --> 00:37.990 start over again and produce one more message, OK? 00:38.370 --> 00:39.420 This message was sent. 00:39.420 --> 00:43.530 And now let's first explore where this message was stored. 00:43.530 --> 00:44.820 I mean, in which partition. 00:45.150 --> 00:50.670 Let me go back to Visual Studio Code and let's try to read again every log file. 00:50.820 --> 00:58.500 And I immediately see that my case, this message was stored in the same partition where my dog was 00:58.500 --> 01:01.440 stored, and that is a partition with a deep one. 01:01.440 --> 01:03.630 In my case, it is second partition. 01:03.930 --> 01:10.410 And if I try to read no messages from the second partition, I should see two messages, Doug and Bonda. 01:10.650 --> 01:14.850 And here I can run the same command as in a previous election. 01:15.000 --> 01:16.140 But with partition. 01:16.140 --> 01:18.840 No, to let me terminate this comment. 01:18.990 --> 01:24.530 And here in a history I have a comment where I have read messages from partition with one. 01:24.660 --> 01:25.970 So let's run it again. 01:27.920 --> 01:34.070 And now I see two messages, dog and Panda, in your case, you should read the competition where you 01:34.070 --> 01:36.830 see actually two massages instead of one. 01:37.260 --> 01:45.340 Wonderful, no, let's try to read massages from specific partyism using a particular offset starting 01:45.350 --> 01:51.020 offset, because here in this comment, we read messages from beginning from the very first offset from 01:51.020 --> 01:52.360 upset number zero. 01:52.730 --> 01:59.770 So let's go to notepad here and let's adjust this comment and add one more option offset. 02:00.080 --> 02:02.780 So let me again copy it up like soul. 02:04.020 --> 02:09.000 Pasted below and here, I'll read message from specific offset. 02:09.710 --> 02:16.470 I'll remove all this dust from beginning and instead of it, I'll add here option offset and I'll throw 02:16.470 --> 02:22.420 it if I zero as a starting of set number and I'll read from protection number one. 02:22.710 --> 02:24.300 So let me copy this comment. 02:25.380 --> 02:28.590 Terminate this one time terminal based command. 02:28.740 --> 02:36.210 So, again, I read messages in topic animals in position number one, and the offset will be zero starting 02:36.240 --> 02:37.590 offset anther. 02:38.310 --> 02:39.720 And I should see two messages. 02:39.720 --> 02:40.820 And yes, here they are. 02:41.280 --> 02:45.900 Now, let's try to read the messages starting from offset number one. 02:46.290 --> 02:48.150 So let me go back to the previous comment. 02:48.150 --> 02:50.790 And that just upset number one like. 02:50.790 --> 02:52.110 So let's run it. 02:53.660 --> 03:00.080 And I have got only a single message, and that is, of course, Bonda, because Bonda has arrived after 03:00.080 --> 03:06.530 dark and that's why it has got upset, number one, because as you already know, the most important 03:06.530 --> 03:10.880 concept is that every message has unique offset, no growth partition. 03:11.030 --> 03:15.970 And in our case, Doug has offset number zero and Bonda has offset number one. 03:16.370 --> 03:23.090 No, if I try to read messages from offset number two like so, I should get an output, of course. 03:23.090 --> 03:24.110 So less executed. 03:25.110 --> 03:31.410 And as expected, I got nothing wonderful, let's terminate this comment and don't let's try to read 03:31.410 --> 03:38.670 Martha just starting from of set number one for all politicians, not just practical opposition for 03:38.670 --> 03:44.130 that look, again, copied this entire command with a description pasted below. 03:44.280 --> 03:51.640 And no, I would like to read messages from specific offset generally, not just from specific protection. 03:51.660 --> 03:55.470 So let me remove this and remove this line like so. 03:56.010 --> 03:59.630 And now I would like to read messages from offset number one. 04:00.330 --> 04:01.620 Let me copy this comment. 04:01.830 --> 04:08.700 And before based on it, please try to answer yourself how many messages now we should get after execution 04:08.700 --> 04:10.800 of this command list provided. 04:11.040 --> 04:18.360 So Command Corbitt bit clear and and based command here again here we will read all messages from topic 04:18.360 --> 04:22.500 animals starting from upset number one antonym. 04:24.530 --> 04:30.890 And we got an arrow looking scroll up and the here at the beginning of this output, we see the partition 04:30.890 --> 04:33.600 is required when offset is specified. 04:34.220 --> 04:40.840 That means that you are not able to read from all partitions, starting from a particular offset. 04:41.840 --> 04:46.810 You must specify a partition number if you want to start from particular offset. 04:47.030 --> 04:48.500 And that's pretty reasonable. 04:48.920 --> 04:49.420 That's the way it. 04:49.430 --> 04:53.280 Let me go back to Notepad and delete this comment in Kafka. 04:53.330 --> 04:58.180 It is not possible to read from a specific offset generally across an entire topic. 04:58.310 --> 05:03.170 You must specify partition number, as we did here in a previous comment. 05:03.420 --> 05:09.380 Let's run this comment once again and try to read messages from partition with it to let's copy this 05:09.390 --> 05:15.590 command, go here, clear terminal based command and I should get a single message. 05:15.590 --> 05:17.120 It is getting my case now. 05:17.120 --> 05:22.370 I don't get any error because now we are reading from a particular partition, starting from a particular 05:22.370 --> 05:22.900 offset. 05:23.450 --> 05:29.050 No, you know how to read messages from all partitions, from a particular partition and from particular 05:29.060 --> 05:31.710 partition starting from particular offset. 05:32.180 --> 05:37.190 There was one more thing left I wanted to demonstrate to here in this example with multiple partitions. 05:37.400 --> 05:41.780 And that's how you are able to read the details about a particular topic. 05:41.870 --> 05:43.970 So let's do that in the next lecture by by.