以前我弄了个程序。消费kafka,但是总消费到ERR__PARTITION_EOF。 我看官方的example里面遇见那个就退出了。咱也不知道这是个啥意思。

最近,用bing搜索查了一下,发现很多人跟我有同样的疑问。然后看到了github上官方的解释。

Repeated _PARTITION_EOF errors when there are still messages in the partition · Issue #283 · confluentinc/confluent-kafka-python · GitHub

edenhill commented on 12 Feb 2018

How many partitions do you have for that topic?

The point of _PARTITION_EOF is to allow certain applications to know when they've reached the end of a partition, one use case is "read all available messages and then exit/do other stuff".
This event can be safely ignored, or turned off with enable.partition.eof=false

 _PARTITION_EOF这个event旨在让程序知道何时他们消费到了partiton的末尾。

例如有个用法就是读取所有的kafka消息,然后干啥点其他什么事儿或者退出。没这个消息的话,就不知道是否到达了末尾。

该事件可以被安全的忽视。或者直接在配置项里关了enable.partition.eof=false 配置项(把它置为false)。

Logo

Kafka开源项目指南提供详尽教程,助开发者掌握其架构、配置和使用,实现高效数据流管理和实时处理。它高性能、可扩展,适合日志收集和实时数据处理,通过持久化保障数据安全,是企业大数据生态系统的核心。

更多推荐