记一次线上Kafka CommitFailedException

CommitFailedException,顾名思义就是Consumer客户端在提交位移时出现错误或异常,还是那种不可恢复的严重异常。
报错:

Caused by: org.apache.kafka.clients.consumer.CommitFailedException: Commit cannot be completed since the group has already rebalanced and assigned the partitions to another member. This means that the time between subsequent calls to poll() was longer than the configured max.poll.interval.ms, which typically implies that the poll loop is spending too much time message processing. You can address this either by increasing the session timeout or by reducing the maximum size of batches returned in poll() with max.poll.records.

大致意思就是,本次提交位移失败,原因是消费者组开启了Rebalance过程,并且将要提交位移的分区分配给了另一个消费者实例,出现这种情况的原因是,消费者实例连续两次调用poll方法的时间间隔超过了期望的max.poll.interval.ms设置的参数值,就是说消费者实例处理消费花费时间过长,耽误了poll的调用。并给出了两个相应的解决办法:
1、增加两次poll时间间隔max.poll.interval.ms参数值
2、减少poll方法一次性返回的消息数量,即减少max.poll.records参数值

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值