We have just talked about some of the most important properties that you could set on a producer basis,
and for the sake of experiment, let's now add, for example, ARC's property and let's modify it to
all.
If I go to documentation, I'll see that the type of this Somalia is doing so even if you specify zero
or one uses.
If I had a string, not as no.
OK, let's go to our project and let's add one more line.
Props, food.
And here will be dogs like this and the VELIA will be old.
And with such certainty in place, the leader will send acknowledgement to producer all the after all,
followers will successfully write the message to replicas.
Ed tells me that there was a typo in this world and actually there was no diaper.
And in order to get rid of this word, I could save this world to dictionary like soul.
And now it is gone.
Great.
No properties were adjusted and now let's try to the following lists instead of integer to use here
simply I in a place where our key is sent like this immediately here I see error cannot infer arguments
and does because string is expected here on this place.
But let's ignore this error and let's try to run our producer.
ISIS, same error here, let me actually add here number and string like this, and also I need to modify
type of producer and I need to modify string here and change it to number like this and make it number
here as well.
And all arrows gone.
Let's now try to rebuild and run our project.
And I see another arrow brought finished with exit cold one, let's look at this error, and if I scored
the beginning of this output, I'll see that producer will start a successful and notice here with a
change in this parameter, we have set it to all instead of default value one.
And after a log of this message to the terminal, we see actual error and it is serialisation exception.
Here it is.
And in the details of the error, we see that it wasn't possible to convert key of glass into.
We have sent actually integer here ASCII.
Let me show you.
Here it is.
And it wasn't possible to convert Lewski to glass twin serializer that was specified in parameters here.
Abal and that's what I have told you before.
If you set up a certain serializer, for example, doing the serializer, then obligational will wait
for squinch here on the blaze of GUI and Velia.
And if you supply something else like in this example, then you'll get Nasta error, actually.
Let me add here Troicki in order to catch such kind of errors and I'll edit here, try and this block
will be in try like this.
And if there was error, exception, error like this, let's bring that to terminal error dot and let's
use method prints stack trace like this.
And let's also use finally and Glos here producer.
Let's move this command here like this.
Great, and let's now try it all around our obligation.
And now we see actually same result, same error, here it is, but now protest finishes was exit code
zero.
It means that it was actually terminated normally because we have got this error rate in order to get
rid of this error.
Let's try to adjust serializer and make it into the serialism.
Actually, if I go to list of possible serializer, here is this step.
You'll see that we're able to use this to realize our integer serializer and let's use it on the place
of the key and let's adjust string serializer to integer serializer like that.
Let's now rerun our obligation.
And now it seems that it works fine and no errors are produced and 100 messages were sent to sum up,
if you have configure specific Serializer or Forgy and voila, you need to supply Key and velia of the
same types.
I mean, is a strange integer or something else.
And let me actually get back to integer here and let's get back to String Serializer Bors Fogie and
Balya and let's replace Nombre with string here.
Actually I could get rid of type's here like this.
They will be inherited and healer's replace Anambra was doing and get back to doing serializer Ofakim.
Wonderful.
Also let's adjust those to improve and instead of importing Kafka producer and produce a record we could
simply get rid of this line and import everything from produce sort of like this.
Great.
That's how our application looks like now and the next.
Let's try to modify actual Bellear of the message that is sent and make it more clear to read and add
timestamp in order to produce more meaningful messages, because now we sent just numbers and the consumer
gets just numbers like this.
Great.
Let's proceed next.