以前我弄了个程序。消费kafka,但是总消费到ERR__PARTITION_EOF。 我看官方的example里面遇见那个就退出了。咱也不知道这是个啥意思。
最近,用bing搜索查了一下,发现很多人跟我有同样的疑问。然后看到了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". |
_PARTITION_EOF这个event旨在让程序知道何时他们消费到了partiton的末尾。
例如有个用法就是读取所有的kafka消息,然后干啥点其他什么事儿或者退出。没这个消息的话,就不知道是否到达了末尾。
该事件可以被安全的忽视。或者直接在配置项里关了enable.partition.eof=false 配置项(把它置为false)。