Skip to content
Advertisement

consuming Kafka Avro massages in Python

I am trying to consume messages from Kafka Avro in Python. We have it in Java, and it’s working, but when trying to consume it in the Jupyter notebook, Parsing does not work. I followed the example given by the documentation: (I’ve removed conf information for security reasons)

JavaScript

This is the error I got:

KafkaError{code=_KEY_DESERIALIZATION,val=-160,str=”‘str’ object is not callable”}

It is worth mentioning that I cannot directly put schema and Avro config in Kafka, similar to what I did in Java.

Advertisement

Answer

Your key deserialization is failing, not the Avro value… You have set an empty string as your key deserializer, which is not a function, or a deserializer instance…

In any case, look at the example code

JavaScript

cannot directly put schema and Avro config in Kafka, similar to what I did in Java.

Assume you mean “in Python” rather than “in Kafka”? Sure, you can. The example loads an .avsc file.

User contributions licensed under: CC BY-SA
7 People found this is helpful
Advertisement