WEBVTT 00:04.230 --> 00:10.680 We have just talked about some of the most important properties that you could set on a producer basis, 00:10.890 --> 00:16.740 and for the sake of experiment, let's now add, for example, ARC's property and let's modify it to 00:16.740 --> 00:17.060 all. 00:17.490 --> 00:25.050 If I go to documentation, I'll see that the type of this Somalia is doing so even if you specify zero 00:25.050 --> 00:26.120 or one uses. 00:26.340 --> 00:28.470 If I had a string, not as no. 00:28.880 --> 00:33.090 OK, let's go to our project and let's add one more line. 00:33.340 --> 00:34.590 Props, food. 00:34.830 --> 00:39.330 And here will be dogs like this and the VELIA will be old. 00:39.630 --> 00:44.940 And with such certainty in place, the leader will send acknowledgement to producer all the after all, 00:44.940 --> 00:48.780 followers will successfully write the message to replicas. 00:49.290 --> 00:54.240 Ed tells me that there was a typo in this world and actually there was no diaper. 00:54.240 --> 00:58.860 And in order to get rid of this word, I could save this world to dictionary like soul. 00:59.070 --> 00:59.970 And now it is gone. 01:00.240 --> 01:00.660 Great. 01:00.900 --> 01:07.320 No properties were adjusted and now let's try to the following lists instead of integer to use here 01:07.320 --> 01:14.880 simply I in a place where our key is sent like this immediately here I see error cannot infer arguments 01:14.880 --> 01:18.240 and does because string is expected here on this place. 01:18.390 --> 01:22.740 But let's ignore this error and let's try to run our producer. 01:25.110 --> 01:32.940 ISIS, same error here, let me actually add here number and string like this, and also I need to modify 01:33.000 --> 01:41.430 type of producer and I need to modify string here and change it to number like this and make it number 01:41.430 --> 01:42.410 here as well. 01:42.450 --> 01:43.660 And all arrows gone. 01:43.800 --> 01:47.190 Let's now try to rebuild and run our project. 01:50.720 --> 01:57.380 And I see another arrow brought finished with exit cold one, let's look at this error, and if I scored 01:57.380 --> 02:02.600 the beginning of this output, I'll see that producer will start a successful and notice here with a 02:02.600 --> 02:06.560 change in this parameter, we have set it to all instead of default value one. 02:07.130 --> 02:14.950 And after a log of this message to the terminal, we see actual error and it is serialisation exception. 02:14.960 --> 02:15.670 Here it is. 02:15.920 --> 02:21.570 And in the details of the error, we see that it wasn't possible to convert key of glass into. 02:22.160 --> 02:24.920 We have sent actually integer here ASCII. 02:25.040 --> 02:25.720 Let me show you. 02:25.730 --> 02:26.480 Here it is. 02:26.810 --> 02:34.540 And it wasn't possible to convert Lewski to glass twin serializer that was specified in parameters here. 02:34.580 --> 02:37.090 Abal and that's what I have told you before. 02:37.280 --> 02:43.220 If you set up a certain serializer, for example, doing the serializer, then obligational will wait 02:43.220 --> 02:47.000 for squinch here on the blaze of GUI and Velia. 02:47.150 --> 02:52.730 And if you supply something else like in this example, then you'll get Nasta error, actually. 02:52.850 --> 03:01.370 Let me add here Troicki in order to catch such kind of errors and I'll edit here, try and this block 03:01.370 --> 03:03.320 will be in try like this. 03:03.950 --> 03:15.470 And if there was error, exception, error like this, let's bring that to terminal error dot and let's 03:15.470 --> 03:18.110 use method prints stack trace like this. 03:18.380 --> 03:22.340 And let's also use finally and Glos here producer. 03:22.460 --> 03:24.980 Let's move this command here like this. 03:26.520 --> 03:29.960 Great, and let's now try it all around our obligation. 03:32.690 --> 03:38.810 And now we see actually same result, same error, here it is, but now protest finishes was exit code 03:38.810 --> 03:39.310 zero. 03:39.440 --> 03:45.320 It means that it was actually terminated normally because we have got this error rate in order to get 03:45.320 --> 03:46.140 rid of this error. 03:46.160 --> 03:51.950 Let's try to adjust serializer and make it into the serialism. 03:52.110 --> 03:56.590 Actually, if I go to list of possible serializer, here is this step. 03:56.870 --> 04:03.140 You'll see that we're able to use this to realize our integer serializer and let's use it on the place 04:03.140 --> 04:09.420 of the key and let's adjust string serializer to integer serializer like that. 04:09.860 --> 04:12.020 Let's now rerun our obligation. 04:14.650 --> 04:22.510 And now it seems that it works fine and no errors are produced and 100 messages were sent to sum up, 04:22.510 --> 04:28.960 if you have configure specific Serializer or Forgy and voila, you need to supply Key and velia of the 04:28.960 --> 04:30.110 same types. 04:30.190 --> 04:33.060 I mean, is a strange integer or something else. 04:33.400 --> 04:40.000 And let me actually get back to integer here and let's get back to String Serializer Bors Fogie and 04:40.000 --> 04:44.330 Balya and let's replace Nombre with string here. 04:44.470 --> 04:48.040 Actually I could get rid of type's here like this. 04:48.280 --> 04:54.670 They will be inherited and healer's replace Anambra was doing and get back to doing serializer Ofakim. 04:55.090 --> 04:55.630 Wonderful. 04:55.630 --> 05:01.660 Also let's adjust those to improve and instead of importing Kafka producer and produce a record we could 05:01.660 --> 05:05.580 simply get rid of this line and import everything from produce sort of like this. 05:06.130 --> 05:06.510 Great. 05:06.760 --> 05:09.640 That's how our application looks like now and the next. 05:09.760 --> 05:17.350 Let's try to modify actual Bellear of the message that is sent and make it more clear to read and add 05:17.620 --> 05:24.070 timestamp in order to produce more meaningful messages, because now we sent just numbers and the consumer 05:24.220 --> 05:25.930 gets just numbers like this. 05:26.290 --> 05:26.560 Great. 05:26.560 --> 05:27.370 Let's proceed next.