WEBVTT 00:04.320 --> 00:11.220 Before starting with our Stapel, let's quickly adjust to this Kafka Commons file and notice that it 00:11.220 --> 00:17.310 is available in the corresponding example folder and the example is called Consumer Groups. 00:17.310 --> 00:22.410 It is example number from and it doesn't require any custom configuration files. 00:22.440 --> 00:25.620 That's why here you'll see only just a single file. 00:25.860 --> 00:29.820 So let's adjust the topic that we will use here in this example. 00:29.820 --> 00:33.350 And instead of Testor, we will use topic numbers. 00:33.660 --> 00:43.650 So let's replace test with numbers like Solt, replace all and also will greet the customer group, 00:43.650 --> 00:45.680 Gold Numbers Group. 00:45.870 --> 00:52.020 So here in the segment where we will start consumer in specific consumer group, we will specify group 00:52.020 --> 00:55.020 name and the here will be name numbers. 00:55.250 --> 01:02.040 This group also, when we will read the consumer group details, we will specify also the name of the 01:02.040 --> 01:03.330 group numbers. 01:03.330 --> 01:05.340 That group like this. 01:05.790 --> 01:06.210 Great. 01:06.390 --> 01:09.930 Let's save this file and let's not start a storekeeper. 01:10.170 --> 01:14.570 Let me copy this command to go to Scaffolder as usually and based command here. 01:15.540 --> 01:22.530 Opened up a new tab and here, let's start just single brolga and get noticed that we will use the default 01:22.980 --> 01:25.830 configuration file located in Quantic folder. 01:25.860 --> 01:28.080 We don't require any cost on file for that. 01:28.440 --> 01:36.960 So let's send it to COFCO and let's place this command here and start our single Breuker wonderful. 01:36.960 --> 01:40.830 This Breuker was started and its ID is default one. 01:40.980 --> 01:41.800 It is zero. 01:42.150 --> 01:47.250 Let's open up a new tab city to Kafka and let's create our number. 01:47.250 --> 01:49.130 Storbeck and the let's. 01:49.470 --> 01:56.400 I just wanted the opposition to file and the obligation factor will be of course, left by default. 01:56.400 --> 02:00.130 One, because we have only just a single Breuker in the last hour. 02:00.150 --> 02:03.720 But that's completely fine for the purposes of this example. 02:04.050 --> 02:09.810 OK, let's select this segment and let's create topic gold numbers. 02:10.770 --> 02:17.910 Topic was created, and now if I list the topics in Kafka, Gloucester, I should see this topic on 02:17.910 --> 02:25.770 the list and yes, here on this great let's not start the producer and the consumer without consumer 02:25.770 --> 02:28.620 group so far and let's produce some messages. 02:28.890 --> 02:32.010 So let's clear terminal here and here. 02:32.010 --> 02:33.830 I'll be running coproducer. 02:34.110 --> 02:41.350 Let's go up at this command based here and it will start producer where we will be able to produce mass. 02:41.370 --> 02:43.020 Just two topic numbers. 02:43.320 --> 02:50.390 Also, let's start the console consumer as before without specific consumer group. 02:50.640 --> 02:56.610 So let's select this command, go to New Tab City to COFCO and start consumer. 02:57.150 --> 03:01.410 Consumer is running and now let's try to produce some messages. 03:01.680 --> 03:07.230 And here let's simply produce numbers like one, two, three. 03:07.680 --> 03:08.330 That's enough. 03:08.850 --> 03:12.890 Let's go to consumer and here we should see all those numbers. 03:13.020 --> 03:13.680 Wonderful. 03:14.160 --> 03:22.590 Let's keep the consumer and producer running and let's open up new tab and let's try to list all consumer 03:22.590 --> 03:25.320 groups that currently exist on the Gloster. 03:25.530 --> 03:33.330 So Sedita COFCO go to list with comments and scroll to this comment that will list all consumer groups. 03:33.660 --> 03:35.280 Let's select this comment. 03:35.280 --> 03:36.780 Go here based. 03:38.850 --> 03:46.740 And now you should see single consumer group with such name, in your case, this number will be different 03:46.740 --> 03:47.320 from mine. 03:47.760 --> 03:48.770 Let's not do the following. 03:48.780 --> 03:54.920 Let's try to lowish one more consumer, same as we did here in this example. 03:55.200 --> 03:57.090 So please keep this consumer on. 03:57.330 --> 04:02.730 Let's open up new tab, sorry, like Seoul and the here city to COFCO. 04:03.030 --> 04:08.850 And let's start now our consumer without iGate Customer Group like this. 04:09.000 --> 04:16.320 So copy this command post here and now as our consumer is running, let's produce a couple of emails 04:16.320 --> 04:18.930 or messages like four and five. 04:20.100 --> 04:23.250 And both consumers should receive those messages. 04:23.280 --> 04:26.910 So here you see those two messages and here you'll see them as well. 04:27.450 --> 04:33.890 Now, let's go again to this last step where we have listed to all consumer groups and repeat same command. 04:34.350 --> 04:38.920 And now you should see two consumer groups and yes, here they are. 04:39.210 --> 04:45.450 And that means that for every of those consumers that we have started in different tabs, different 04:45.450 --> 04:53.370 consumer groups where we greed and purpose of creation of consumer groups in Kafka is actually reducing 04:53.370 --> 04:55.480 of loda on consumers. 04:55.800 --> 05:01.130 So let's imagine that there was a topic that has multiple producers that produce messages to it. 05:01.320 --> 05:06.600 And throughput is really, really high and it gets thousands of messages per second. 05:06.990 --> 05:13.440 And if there was just a single consumer, this consumer will be able to survive under such high alert 05:13.440 --> 05:16.570 and that we won't be able to process all those messages in time. 05:17.190 --> 05:24.450 That's why you are able to create a group of consumers that will consume messages from the same topic 05:24.690 --> 05:28.260 and messages will be spread across different consumers. 05:28.380 --> 05:32.510 So every consumer will get part of the messages in specific topic. 05:32.700 --> 05:37.300 And in such case, load on every consumer will be greatly reduced. 05:37.410 --> 05:40.410 That's actually the purpose of creation of consumer groups. 05:40.740 --> 05:45.320 And as you see, by default, every consumer must belong to a specific group. 05:45.540 --> 05:49.880 And if you don't specify group yourself, this group will be created automatically. 05:50.100 --> 05:54.870 And now we see that the two different consumers belong to different consumer groups. 05:55.740 --> 05:56.160 Great. 05:56.340 --> 06:00.150 Let's all-Clear clear terminal here and go to list with comments. 06:00.360 --> 06:05.240 And let's not try to read the details about the specific consumer group. 06:05.400 --> 06:11.190 It is the last command here on the list and here in group option, you should specify the name of the 06:11.190 --> 06:11.450 group. 06:11.730 --> 06:17.700 Actually, I need again list groups here in order to get the number of specific groups. 06:17.940 --> 06:20.460 And you could copy any of those names. 06:20.460 --> 06:21.810 Let me copy this one. 06:21.810 --> 06:23.370 Go here and here. 06:23.370 --> 06:30.690 Instead of no group, let me temporarily place the name of this group and select this command and based 06:30.690 --> 06:31.020 here. 06:32.920 --> 06:35.990 And now I see the tales about specific consumer group. 06:36.280 --> 06:42.150 Let me make it a bit smaller and try to feed it to the screen like this probably. 06:42.460 --> 06:49.030 And here you'll see if all the information, you'll see group name, you'll see topic, you'll see partition 06:49.030 --> 06:51.990 can't offset a look and offset and so on. 06:52.240 --> 06:58.000 I'll explain each of those columns a bit later when we will start the consumer in a cost on consumer 06:58.000 --> 06:58.350 group. 06:58.690 --> 07:05.410 But now I just want to point your attention to the fact that here in this output, you'll see information 07:05.410 --> 07:08.580 about all partitions in specific topic. 07:08.890 --> 07:14.500 So at the moment, our consumers are listening to messages in topic numbers. 07:14.830 --> 07:21.730 And that's why here you see topic numbers and all five partitions that we have created for this topic. 07:22.030 --> 07:26.320 And for each partition you see idea of specific consumer debt. 07:26.320 --> 07:28.780 Currently, consumers matter just from it. 07:29.440 --> 07:36.550 And in such case, you see here the same idea, same consumer idea that was created automatically for 07:36.550 --> 07:37.640 all partitions. 07:38.430 --> 07:45.580 That's because at the moment we have just a single consumer that consumes Matha just from all partitions 07:45.820 --> 07:54.070 in topic numbers, if you repeat same command, but use here and now as a group or accept that there 07:54.070 --> 07:56.050 are currently two different consumers around. 07:56.440 --> 08:03.070 And in my case, I could replace this number with this number one three one one zero. 08:03.190 --> 08:07.930 And with the tales about that group, you should see a similar feature. 08:08.290 --> 08:10.180 Again, topic is numbers. 08:10.420 --> 08:18.880 Here you see another group with this name and the consumer idea is different, but it is the same for 08:18.880 --> 08:20.980 all partitions in this output. 08:21.370 --> 08:27.190 And again, it indicates that there was another consumer that is currently connected to top economic 08:27.190 --> 08:30.370 growth and reads messages from all partitions. 08:30.520 --> 08:34.390 So again, consumer ID here is the same for all partitions. 08:34.810 --> 08:40.960 There's details about the consumer groups that were created automatically when we have started those 08:40.960 --> 08:42.090 two consumers. 08:42.490 --> 08:43.120 Wonderful. 08:43.370 --> 08:51.130 Let's now stop this consumer and this consumer like so and let's try to read the list of consumer groups 08:51.130 --> 08:51.580 again. 08:52.060 --> 08:58.540 Let me clear Terminal four now, make it a bit larger and go back in history to the command to where 08:58.540 --> 09:01.900 we have leased it to all consumer groups and press enter. 09:02.410 --> 09:08.590 I still see the same consumer groups, but if you repeat same comment a bit later, those consumer groups 09:08.590 --> 09:09.870 will be disappeared. 09:09.880 --> 09:15.340 If I try to start consumer once again, for example, let's start this consumer once again. 09:15.550 --> 09:23.350 Let's do that with the same topic numbers and go here and repeat this comment that will list all consumer 09:23.350 --> 09:23.770 groups. 09:24.010 --> 09:31.450 You'll see one more consumer group that was again created automatically for another consumer, because 09:31.450 --> 09:34.840 technically this consumer is brand new consumer. 09:35.020 --> 09:41.290 And if you specify option does this from beginning, you should get old messages that exist in topic 09:41.290 --> 09:41.890 numbers. 09:42.550 --> 09:48.310 OK, let's not stop this consumer and the close to doorsteps with consumers. 09:48.550 --> 09:51.310 And actually let's close this tab as well. 09:51.460 --> 09:56.590 And the next day, let's create custom consumer with customer group name. 09:56.950 --> 09:58.820 So let's proceed in the next lecture. 09:58.840 --> 09:59.320 Bye bye.