简体   繁体   English

KafkaError与Confluent Python Kafka使用者不支持的压缩编解码器0x3

[英]KafkaError Unsupported compression codec 0x3 with Confluent Python Kafka consumer

I set up Confluent Python Kafka consumer on my laptop (Ubuntu 17) and everything is fine, I can listen to remote topics and receive messages. 我在笔记本电脑(Ubuntu 17)上安装了Confluent Python Kafka消费者,一切都很好,我可以收听远程主题并接收消息。

But when I try to set it up on a server (Ubuntu 16), there is what seems to be a compression issue. 但是,当我尝试在服务器(Ubuntu 16)上进行设置时,似乎存在压缩问题。 The data comes from Divolte and is compressed with LZ4. 数据来自Divolte,并使用LZ4压缩。

The data is received successfully without any error when first connecting to a topic, but after closing and re-opening the consumer, a first message is received and an error is thrown: 首次连接到主题时,数据已成功接收,没有任何错误,但是在关闭并重新打开使用者后,会收到第一条消息并引发错误:

<cimpl.Message object at 0x7f089db67180>
KafkaError{code=_NOT_IMPLEMENTED,val=-170,str="Unsupported compression codec 0x3"}

I think it's not from Divolte data source but more like a message from Kafka, but I cannot read its value since the error happens before (msg is printed and then we jump to elif for the error): 我认为它不是来自Divolte数据源,而更像是来自Kafka的消息,但是由于错误发生在之前,所以我无法读取它的值(先打印msg,然后跳转到elif出现错误):

c = Consumer({'bootstrap.servers': server['server'], 'group.id': 'mygroup',
              'default.topic.config': {'auto.offset.reset': 'smallest'}})
c.subscribe([server['topic']])
running = True
while running:
    msg = c.poll()
    print(msg)
    if not msg.error():
        msg_value = msg.value()
        print(msg_value)
    elif msg.error().code() != KafkaError._PARTITION_EOF:
        print(msg.error())
        running = False

Sounds like this problem which should be fixed in 0.10.0 or higher 听起来像是这个问题,应该将其固定为0.10.0或更高

https://issues.apache.org/jira/browse/KAFKA-3160 https://issues.apache.org/jira/browse/KAFKA-3160

确实,这似乎是一个版本问题,但显然没有必要使用0.10,我按照http://docs.confluent.io/current/installation.html重新安装存储库和融合平台,然后从0.9.1更新了librdkafka1和librdkafka-dev。到0.9.5,它解决了我的问题!

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM