WEBVTT 00:04.340 --> 00:10.880 We have just analyzed what is happening now in our Closter in the group numbers, and at the moment 00:10.880 --> 00:12.620 there was just a single consumer. 00:12.640 --> 00:18.590 It is raining here and that's why this consumer is now connected to all politicians. 00:18.590 --> 00:22.610 And that's why here in this column, you see same consumer ID. 00:22.940 --> 00:29.450 And though it's a great time to start one more consumer in the same consumer group numbers, let's do 00:29.450 --> 00:29.660 that. 00:30.110 --> 00:36.620 Let's go to the list of comments and find comments that will start console consumer in specific group 00:36.770 --> 00:37.580 here with these. 00:37.850 --> 00:40.760 And let's also read messages from beginning. 00:41.000 --> 00:46.970 And again, please notice that here we specify group and in our case, group is NAMS. 00:47.300 --> 00:49.460 So let's copy this comment. 00:49.970 --> 00:51.530 Open up new tab. 00:51.540 --> 00:52.790 Let me move it here. 00:52.970 --> 01:00.260 And the city to Cafcass usually and the run consumer here again, we are starting to want more consumer 01:00.470 --> 01:07.550 in the same group numbers and notice that in council after execution of this command, we see empty 01:07.550 --> 01:08.240 output. 01:08.450 --> 01:14.610 No single message was consumed by this consumer, but we have added here from beginning option. 01:14.660 --> 01:20.540 What happens, why no messages were received by this consumer answer was pretty simple. 01:20.900 --> 01:28.430 There was another consumer in the same group, NOM's, that has already consumed all messages in this 01:28.430 --> 01:29.390 topic numbers. 01:30.110 --> 01:36.290 That's why this consumer gets nothing before producing one or two and other messages. 01:36.560 --> 01:43.010 Let's go to this step, last one, where we can read details about the group numbers and let's read 01:43.010 --> 01:44.270 those details now. 01:44.450 --> 01:44.840 So. 01:46.150 --> 01:52.760 And now you should see a bit different picture and difference is here in consumer I.D. column. 01:53.140 --> 02:00.550 Now you should see here two different IDs and in my case, previous consumer with this idea is still 02:00.550 --> 02:01.180 connected. 02:01.180 --> 02:08.980 And the consumers messages from partitions, zero, one and two and new consumer with new ID here or 02:09.000 --> 02:16.150 this is connected now to two remaining partitions, to partitions with IDs, three and four. 02:17.110 --> 02:22.990 And now you see that partitions where actually equally spread across different consumers. 02:23.410 --> 02:29.740 Now there are two consumers in a group in total file partitions, and it's fair that one consumer will 02:29.740 --> 02:33.070 get three partitions and another will get two partitions. 02:33.580 --> 02:36.100 That's how picture looks like at the moment. 02:36.820 --> 02:44.100 Let's now go to producer and producer one additional message and see which consumer will get this message. 02:44.560 --> 02:48.400 So let's go to producer and produce number seven. 02:49.220 --> 02:56.830 And I see it that Mikey's first consumer has consumed this message, and second, consumer remains silent, 02:57.050 --> 03:04.120 it does not get the same message because no messages will be spread across different consumers. 03:04.400 --> 03:11.720 And if one of the consumers receives one of the messages, same message will not be received by remaining 03:11.720 --> 03:12.470 consumers. 03:13.130 --> 03:17.750 That's actually the idea behind the creation of multiple consumers in the same group. 03:18.410 --> 03:25.420 Let's now go back to the last step and execute same comment and raillery details about this NOM's group. 03:26.300 --> 03:32.660 And now I see that in my case, this last message has landed in competition with to. 03:33.510 --> 03:38.110 Consumer with this ad is my first consumer is connected to this protection. 03:38.230 --> 03:41.930 That's why this consumer has consumed this message. 03:42.510 --> 03:45.260 Let's produce one or two additional messages. 03:45.450 --> 03:48.360 So here comes number eight and nine. 03:48.840 --> 03:55.320 And I see that second consumer in my case has received both messages, eight and nine. 03:55.770 --> 04:02.970 And I could predict that those two messages were written to either partition three or partition four, 04:03.270 --> 04:07.560 because now my second consumer is connected to those two partitions. 04:07.650 --> 04:13.070 But it's more correct to say that those two partitions were assigned to the second consumer. 04:13.410 --> 04:14.910 Let's execute this command. 04:17.010 --> 04:23.240 And yes, I see that one of the messages was written to partition three and another one was written 04:23.250 --> 04:28.760 to partition with a default, and those partitions are assigned to second consumer. 04:28.920 --> 04:32.250 That's why this consumer has received those messages. 04:33.310 --> 04:39.400 Let's now start one more consumer in the same group, but let's make apples and do the next by.