WEBVTT 00:04.290 --> 00:11.040 You have just seen that for every separate consumer, separate consumer group will be created automatically. 00:11.430 --> 00:17.190 And now let's create custom consumer group and let's name it no as a group. 00:17.370 --> 00:21.610 And let's again read messages from the same topic as before topic numbers. 00:21.990 --> 00:23.520 Let me go up at this command. 00:24.740 --> 00:26.970 Let's keep this producer up and running. 00:27.110 --> 00:32.920 Let's open up New Tab City to Kafka and here paste, come on again. 00:32.930 --> 00:38.180 This will create the new consumer in a new group called Numbers Group. 00:38.180 --> 00:41.530 And this consumer will read messages from topic numbers. 00:41.960 --> 00:47.120 And as you'll see here, we have received all messages that were produced before. 00:47.180 --> 00:50.150 We have produced numbers from one to five. 00:50.330 --> 00:54.390 And that's reasonable because now we have only a single consumer in the consumer group. 00:54.890 --> 00:56.960 Let's keep this consumer running. 00:56.990 --> 01:03.740 Let's open up New Tab City to Kafka and the now read the tales about consumer groups. 01:03.740 --> 01:08.870 And let's first list all groups like this copied this command based here. 01:10.070 --> 01:16.290 And now I see another consumer group here on the list, and it is a non-profit group, and noticed that 01:16.290 --> 01:21.510 the previous automatically created consumer groups are still here, but please just ignore them. 01:21.860 --> 01:24.520 We are interested now in this group numbers group. 01:24.920 --> 01:26.900 Let us know Riverdale's about this group. 01:26.900 --> 01:31.190 And here, let's use this comment with describe option. 01:31.190 --> 01:35.150 And here in a group name will be numbers. 01:35.630 --> 01:37.870 This group like this. 01:38.300 --> 01:39.590 Let's go up to this command. 01:40.890 --> 01:43.590 Clear time and all here and past comments like this. 01:44.950 --> 01:47.290 Let me make it a bit smaller like this. 01:47.830 --> 01:52.950 Actually, this output looks very small on your screen, so let me just add the following. 01:52.960 --> 01:58.670 Let's get rid of numbers, a group, and let's just agreed the group numbers, pretty short name. 01:58.960 --> 02:04.230 Let's go to list of commands and replace numbers, a group everywhere with numbers. 02:04.600 --> 02:09.070 So let's replace numbers group with numbers like this. 02:09.560 --> 02:10.560 Replace all. 02:10.840 --> 02:15.650 And now let's restart our consumer here. 02:15.850 --> 02:20.740 Let's stop this one and let's start it over again in group numbers. 02:21.070 --> 02:27.400 So let me go to this command where we have started consuming and now a group name will be simply names. 02:27.730 --> 02:31.930 So let me copy it pasted here again. 02:31.930 --> 02:35.710 We have consumed all messages and now let me go to this step back. 02:35.710 --> 02:39.460 And instead of numbers, a group here will be just numbers. 02:41.220 --> 02:41.820 Like this. 02:44.110 --> 02:46.370 And now let me make it a bit larger. 02:47.080 --> 02:49.810 And now we have a bit more space. 02:49.930 --> 02:54.300 Let me repeat this comment and let me describe now what you see here in this hour. 02:54.970 --> 03:00.460 First of all, U.S. consumer group, and it is Noma's in our case topic is numbers. 03:00.790 --> 03:07.030 Here you see five partitions and now you see current of offsets for all partitions. 03:07.540 --> 03:11.860 And in this column, you see Comi offset by consumers. 03:12.010 --> 03:19.660 In my case, I see current offset for four, partition three and current offset one for partition four. 03:20.140 --> 03:27.190 And from this output, you could understand how many messages are currently stored in specific partition, 03:27.910 --> 03:30.310 which will produce the Justifier messages. 03:30.340 --> 03:36.310 So from here they and all those five messages were spread across five different partitions. 03:36.550 --> 03:42.310 And in my case, it happened in such a way that four of math, just where I thought in partition with 03:42.310 --> 03:47.530 India three and one more message was thought in partition for Let's Not. 03:47.540 --> 03:53.170 We did the following in order to ensure that this table accurately reflects a picture of distribution 03:53.170 --> 03:55.030 of messages across different partitions. 03:55.360 --> 03:59.890 Let's not quickly start one more consumer without customer consumer group. 04:00.040 --> 04:03.010 And let's try to read messages from a specific partition. 04:03.160 --> 04:09.520 And you could read from partition where you see one or two messages and I'll read in my case from Partition 04:09.520 --> 04:14.350 with ID from let's go to our commands list and the list copied this command. 04:14.350 --> 04:22.540 Where are we able to start consumer and the let's start console consumer and read from a specific partition. 04:25.300 --> 04:29.140 Like this, and here will be partition. 04:30.200 --> 04:37.100 In my case, I'll read from protection with Deep for like this, and we want to read from beginning, 04:37.130 --> 04:39.590 let's add here option from beginning. 04:40.580 --> 04:42.020 Like this, don't forget. 04:43.100 --> 04:50.930 Let me copy this comment, open up new tab here, city to Kafka and let's start one more consumer and 04:50.930 --> 04:57.530 with messages from protection for in my case and I just Google message, and that means that this table 04:57.530 --> 04:59.180 is accurate and correct. 04:59.180 --> 05:03.710 It shows the Protestant with a default in my case has just a single message. 05:04.250 --> 05:09.800 Again, in this table, you see the tales about the consumers in specific consumer groups. 05:10.190 --> 05:15.140 And we are reading now details about consumer group gold numbers. 05:15.770 --> 05:22.820 And in this consumer group at the moment, there was just a single consumer hearing this week of just 05:22.820 --> 05:24.140 launched one more consumer. 05:24.140 --> 05:27.710 But now we are safe to stop it and simply close the step. 05:27.710 --> 05:29.020 We don't need it anymore. 05:29.240 --> 05:33.290 Again, in group numbers, we have just single consumer at the moment. 05:33.290 --> 05:40.010 And that's why here in this column with consumer ID, you'll see same consumer ID for all politicians. 05:40.490 --> 05:45.680 And that means that the single consumer is or we don't know from all politicians. 05:46.160 --> 05:54.590 And so far this consumer has consumed all five messages that exist in this topic numbers. 05:55.520 --> 06:02.090 And that's why here in this column, look and I've said you see same numbers that are equal to current 06:02.090 --> 06:03.490 offset numbers here. 06:03.500 --> 06:07.500 In my case, AC4, same us here and here I see one. 06:07.520 --> 06:09.380 Same as here in this column. 06:09.770 --> 06:15.640 And again, those numbers are committed of self for particular consumer. 06:15.920 --> 06:23.180 This consumer with this ad has committed that it has received all four messages from this topic. 06:23.750 --> 06:26.700 Let's not produce one more message to our Closter. 06:26.900 --> 06:30.380 Let's go to producer and produce message six like this. 06:31.680 --> 06:34.920 Let's go back to consumer, it has received this message. 06:35.190 --> 06:39.840 Let's go back to the step and read details about consumer group. 06:40.350 --> 06:46.740 And now I see that quantity of messages in partition with 84 was increased to two. 06:47.130 --> 06:50.760 Current of is two and look and offset is two. 06:50.940 --> 06:57.900 And that means that this consumer with this idea has successfully received both messages in this particular 06:57.900 --> 06:58.470 partition. 06:59.010 --> 07:02.280 Next column after look and offset is gold leg. 07:02.610 --> 07:09.900 And at the moment we see here all zeros, but you'll see here non-zero numbers if specific consumer 07:10.050 --> 07:14.430 has not yet consumed all messages that are present in specific position. 07:14.790 --> 07:20.460 And that may happen when producers produce faster than consumer is able to consume. 07:20.790 --> 07:28.230 In the next column, consumer ID, you see consumer ID that was created automatically and consumer ID 07:28.290 --> 07:30.630 must be unique for every connection to Kafka. 07:30.630 --> 07:35.010 Gloster also you'll see here columns, host and client ID. 07:35.280 --> 07:40.340 Client ID is usually the same for all consumers in specific consumer group. 07:40.350 --> 07:48.660 And as you see, it consists here of a prefix consumer, then name of the group and then no one in the 07:48.660 --> 07:48.960 host. 07:48.960 --> 07:53.550 Golman you'll see actually apologists of the computer where consumer is located. 07:53.910 --> 07:54.530 Wonderful. 07:54.750 --> 08:01.920 That's how our picture looks like in a case when we have started only a single consumer in a consumer 08:01.920 --> 08:02.250 group. 08:02.760 --> 08:04.500 Let's make things more interesting. 08:04.500 --> 08:10.260 And the next start, one more consumer in the same consumer group called NOM's. 08:10.590 --> 08:12.230 Let's do the next buy by.