WEBVTT 00:04.230 --> 00:10.590 We have just created the producer using Python, and it took just three lines of code and we have sent 00:10.590 --> 00:18.480 the message to big test and this topic was absent in our coffeecake last hour and it should have been 00:18.480 --> 00:19.740 created automatically. 00:20.070 --> 00:26.970 Let's verify that basically by creating a consumer in Python and connect to this topic and receive messages. 00:27.330 --> 00:30.030 Let's go to our consumer file. 00:30.030 --> 00:31.310 At the moment it is empty. 00:31.500 --> 00:39.710 And let's start by importing Kalifa consumer from Kafka package from Kafka import Kafka consumer. 00:39.720 --> 00:41.660 You could use autocomplete here. 00:41.910 --> 00:48.020 And next, let's create consumer consumer equals sign Kafka consumer. 00:48.210 --> 00:50.760 And here we need to specify a list of parameters. 00:50.760 --> 00:56.110 And of course the topic name is mandatory and bootstrap sarus parameter is mandatory. 00:56.400 --> 00:58.830 Let me explain that in several lines. 00:58.830 --> 01:01.020 And the first topic name. 01:01.290 --> 01:02.820 It is a test in our case. 01:02.970 --> 01:11.910 And next, let's specify bootstrap sarus configuration parameter bootstrap underscore Saras and it is 01:11.910 --> 01:14.850 equal to the same set of salaries that we have used here. 01:14.870 --> 01:17.090 Let me put this away from here. 01:18.720 --> 01:25.900 It go here and based and also let along with bootstrap Sarah's parameter, specify group ID parameter. 01:26.100 --> 01:28.400 Let's do that on a separate line. 01:28.770 --> 01:37.350 This parameter is called Group Underscore Edem and let's set it equal to, let's say, test consumer 01:37.530 --> 01:38.940 group like Sole. 01:39.240 --> 01:45.360 And now we are able to start consumption of the messages and we could do that in following way for message 01:45.990 --> 01:47.150 in consumer. 01:47.610 --> 01:55.050 Let's simply print this message, print message like so let's save this code and let's start our consumer 01:55.050 --> 01:55.530 here. 01:55.650 --> 01:58.130 And for that, I'll use again Python three. 01:58.140 --> 02:00.810 And here, let's start consumer file. 02:01.470 --> 02:05.540 It is running now, but we have not specified that we want to get messages from beginning. 02:05.730 --> 02:10.690 That's why we need to rerun producer and send this message. 02:11.040 --> 02:19.080 Let's open up new tab here and let's clear this terminal and the left and our bottom three producer, 02:19.290 --> 02:22.330 Dot UI and our message was sent. 02:22.350 --> 02:28.330 Let's go to Three-step, this one, and we should see that the message was received by consumer dot 02:28.350 --> 02:28.680 UI. 02:30.000 --> 02:35.850 It seems that the consumer does not get any messages and it seems that producer doesn't produce any 02:35.850 --> 02:37.280 messages, probably. 02:37.360 --> 02:44.010 This happens because the process finishes pretty quick and quicker than this message is sent. 02:44.340 --> 02:50.790 Let me actually put here time and add the sleep timer import. 02:51.960 --> 03:02.370 Time and here after this line, lets time sleep and let sleep, let's say 20 seconds, let's save this 03:02.370 --> 03:02.820 cold. 03:03.480 --> 03:08.520 Let's go to Deba with producer on it once again. 03:09.420 --> 03:11.320 Notice that now it is still raining. 03:11.610 --> 03:13.140 Let's go to consumer. 03:13.770 --> 03:16.470 And yes, now we have received message. 03:16.710 --> 03:21.710 And that was actually the reason why my producer was not able to send a message. 03:21.720 --> 03:27.240 Broadcast was killed before this message was sent and now we have received message. 03:27.240 --> 03:34.320 And actually next let's try to modify our producer and send more messages instead of just one. 03:34.560 --> 03:35.520 I'll see you next. 03:35.530 --> 03:36.060 Bye bye.