WEBVTT 00:04.450 --> 00:10.600 We have just observed the tails of our new topic month, and we have seen that each politician now has 00:10.600 --> 00:17.170 three different replicas and one of those replicas is actually leader for every politician, no less 00:17.170 --> 00:20.800 Stratolaunch producer and consumer and the producer massages. 00:21.070 --> 00:23.120 And first, let's launch consumer. 00:23.290 --> 00:24.880 Let's take this comment. 00:26.060 --> 00:32.570 Open up new tab, let's keep this step open, because we will get back to this command later on when 00:32.570 --> 00:35.020 we will try to bring down one of the brokers. 00:35.210 --> 00:40.730 So let's open up new untapped gold, took off scaffolders usually and start consumer. 00:41.810 --> 00:48.460 Consumer will start let's open up New LDAP City to Kafka again, let's take command that will launch 00:48.470 --> 00:51.620 producer copied and paste here. 00:53.440 --> 00:59.650 OK, my producer is running and now let's produce some messages to our topic month, and you might guess 00:59.650 --> 01:01.720 that I'll write the names of demands. 01:01.930 --> 01:03.700 So first months will be January. 01:05.590 --> 01:06.880 Next one, February. 01:09.830 --> 01:10.400 March. 01:12.090 --> 01:12.840 April. 01:14.080 --> 01:14.590 June. 01:15.580 --> 01:16.300 July. 01:17.380 --> 01:17.930 August. 01:18.100 --> 01:23.290 OK, it's enough, let's go now to consumer and verify whether it has received all those messages or 01:23.290 --> 01:23.670 not. 01:23.740 --> 01:24.720 So let's go there. 01:25.060 --> 01:29.320 And yes, here we see old messages from January to August. 01:29.500 --> 01:36.630 And notice that now we see actually the same order of the messages that we have produced here on producer. 01:37.120 --> 01:39.130 And the reason for that is simple. 01:39.310 --> 01:46.720 We have produced those messages one by one consumer was already running, was started before, and that's 01:46.720 --> 01:53.800 why it has received all those messages also one by one in the same order as they were produced here. 01:54.430 --> 02:01.750 But now let's quickly try to stop this consumer and try to start it over again with option from beginning 02:01.900 --> 02:04.750 and to observe whether we will get same order or not. 02:05.290 --> 02:06.010 We'll stop it. 02:06.490 --> 02:12.940 Go to our magic file and let's select this command that will read messages from Beginning Topic Month. 02:13.360 --> 02:14.050 Copy it. 02:14.380 --> 02:15.610 Clear terminal here. 02:16.000 --> 02:17.720 Based Command after. 02:19.680 --> 02:26.520 And now, as expected, I got a completely different order of those massages, and again, the reason 02:26.520 --> 02:32.740 for that is that producer has written those messages to different politicians, not particularly in 02:32.740 --> 02:36.750 the Round-Robin fashion statement from the politician with a zero. 02:37.050 --> 02:39.420 So order is completely mixed. 02:39.870 --> 02:45.130 And that's why here on the consumer side, I got Aude also mixed. 02:45.890 --> 02:46.260 Great. 02:46.450 --> 02:49.980 Let's now produce one or two messages additionally to those. 02:50.190 --> 02:51.300 So September. 02:53.180 --> 02:53.990 October. 02:55.170 --> 02:55.960 November. 02:56.340 --> 03:03.960 So let's type all month and December, wonderful, 12 months just produced, and if I get here back 03:03.960 --> 03:10.370 to consumer, I see messages starting from September in the same order as they were produced by producer. 03:10.590 --> 03:16.020 And again, the reason for that is that the consumer was already running while we were producing those 03:16.020 --> 03:19.860 messages by producer, and that's why it was receiving them one by one. 03:20.310 --> 03:23.310 It seems that I have forgotten Makia. 03:23.310 --> 03:24.120 Sorry for that. 03:24.210 --> 03:26.750 So only 11 messages were produced. 03:27.000 --> 03:29.320 Let's add me here after December. 03:29.520 --> 03:30.240 Sorry for that. 03:31.190 --> 03:35.430 Great and May has appeared here at the end of the list at consumer site. 03:35.840 --> 03:40.640 Let's not quickly stop this consumer and let's try to read from particular partition. 03:40.820 --> 03:41.690 So let's stop it. 03:42.050 --> 03:49.120 Go to our file with comments and let me select this comment based here. 03:50.010 --> 03:54.600 And now I'll start consumer and with messages from specific. 03:55.900 --> 03:56.590 Partizan. 03:58.540 --> 04:01.600 And here will be, let's say, partition. 04:03.030 --> 04:07.390 Let's say we say the three bucks here and from beginning. 04:07.680 --> 04:09.540 OK, let's copy this comment. 04:10.730 --> 04:12.500 Clear terminal and based here. 04:14.770 --> 04:17.810 And now I get only three messages in my case. 04:17.830 --> 04:23.140 January, April and August, in your case, you will get completely different messages because in your 04:23.140 --> 04:27.520 case, messages will be spread across different partitions in a completely different way. 04:28.090 --> 04:30.400 Let's try to read from us repartition. 04:30.400 --> 04:35.310 So let me stop this and let's change partition number two, let's say six. 04:35.740 --> 04:39.710 Remember that in total we have seven partitions starting from zero. 04:39.710 --> 04:40.280 Also lost. 04:40.300 --> 04:41.700 One will be with 86. 04:42.100 --> 04:44.170 Let me copy it based here. 04:45.810 --> 04:48.110 And now I receive only two messages. 04:48.210 --> 04:54.900 July and November, let's also quickly try to add offset option instead of from beginning to end this 04:54.900 --> 04:55.250 comment. 04:55.560 --> 04:56.680 Well, let's go back here. 04:56.700 --> 04:58.950 Let me quickly go up into entire comment. 05:00.570 --> 05:09.530 Based here below, so start from specific protection and and specific of set and here instead of from 05:09.540 --> 05:10.430 beginning will be. 05:11.460 --> 05:13.230 Offset, let's say one. 05:13.500 --> 05:20.370 And let me read from Partition with ID3, because this partition in my case has three messages and I 05:20.370 --> 05:23.280 want to start from offset with number one. 05:23.430 --> 05:26.490 And I should get the two messages, April and August. 05:26.770 --> 05:32.630 So let me select this command in your case, please select partition that has at least two messages. 05:32.850 --> 05:34.530 So let me copy this command. 05:34.890 --> 05:37.050 Terminate this based. 05:38.990 --> 05:45.470 And yes, I got only two messages, April and August, if I change of said to do in my case again, 05:45.470 --> 05:51.500 because I have three messages here in this petition, I could get only last one August. 05:52.310 --> 05:52.670 Yes. 05:52.670 --> 05:53.210 Here it is. 05:53.570 --> 05:54.200 Wonderful. 05:54.440 --> 05:54.890 Let us know. 05:54.890 --> 06:00.980 Also, quickly go back to log's for those where old messages are stored actually on each of the brokers 06:01.100 --> 06:06.200 and the lists, observe the contents of the partition with ID3, but let's go. 06:06.200 --> 06:08.030 One is usually after the small balls. 06:08.060 --> 06:08.830 So see you next. 06:08.840 --> 06:09.310 Bye bye.