kafka consumer 消费到 ERR__PARTITION_EOF问题

以前我弄了个程序。消费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)。

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值