[英]confluent-kafka python avro messages
So, I can successfully use the python confluent-kafka api to consume messages from Kafka that are text encoded. 因此,我可以成功使用python confluent-kafka api来消耗来自Kafka的文本编码消息。
When I try to consume Avro encoded (binary) messages, I get a UnicodeDecodeError exception on: 当我尝试使用Avro编码的(二进制)消息时,出现以下情况的UnicodeDecodeError异常:
msg = kafka_consumer.poll(timeout=2.0)
Obviously, Avro encoded values are binary, not Unicode. 显然,Avro编码的值是二进制而不是Unicode。 With the Java API, I can specify a KafkaAvroDeserializer to the KafkaConsumer constructor.
使用Java API,我可以为KafkaConsumer构造函数指定一个KafkaAvroDeserializer。 The Python API seems to have no parallel or similar configuration option to this.
Python API似乎对此没有并行或类似的配置选项。
The configuration options that can be passed to the underlying librdkafka don't seem to specify any custom (de)serializer or decoder or avro related options. 可以传递给底层librdkafka的配置选项似乎并未指定任何自定义(反)序列化器或解码器或与Avro相关的选项。
https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md https://github.com/edenhill/librdkafka/blob/master/CONFIGURATION.md
How do I consume Avro encoded messages with the Python confluent-kafka api? 如何使用Python confluent-kafka api使用Avro编码的消息?
在irc上,#kafka的一位开发人员表示,这是confluent-python 3.0发行版中的一个错误,已在master分支中进行了修复,而该修复将在下一个发行版中进行。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.