• 首页 首页 icon
  • 工具库 工具库 icon
    • IP查询 IP查询 icon
  • 内容库 内容库 icon
    • 快讯库 快讯库 icon
    • 精品库 精品库 icon
    • 问答库 问答库 icon
  • 更多 更多 icon
    • 服务条款 服务条款 icon

Error sending fetch request (sessionId=INVALID, epoch=INITIAL) to node 0

武飞扬头像
this is a book
帮助1

1 背景

使用 kafka Java Client消费 kafka中的消息,但是消费不到消息,而且日志中打印如下信息

Error sending fetch request (sessionId=INVALID, epoch=INITIAL) to node 0: {}.

2 问题解决

解决问题的前提是 kafka集群的运行状态是正常的,而且kafka和消费者之间的网络是畅通的

增加如下配置

  properties.setProperty("session.timeout.ms","600000");
  properties.setProperty("request.timeout.ms","600000");

3 解决问题思路

首先要学会查看官网,官网才是有公信力的

Apache Kafka

The expected time between heartbeats to the group coordinator when using Kafka's group management facilities. Heartbeats are used to ensure that the worker's session stays active and to facilitate rebalancing when new members join or leave the group. The value must be set lower than session.timeout.ms, but typically should be set no higher than 1/3 of that value. It can be adjusted even lower to control the expected time for normal rebalances.

Type: int
Default: 3000 (3 seconds)
Valid Values:  
Importance: high

默认是45秒中会报超时,我将这个配置调整到了10分钟

学新通   默认是30秒超时,我调整为30分钟

这篇好文章是转载于:学新通技术网

  • 版权申明: 本站部分内容来自互联网,仅供学习及演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,请提供相关证据及您的身份证明,我们将在收到邮件后48小时内删除。
  • 本站站名: 学新通技术网
  • 本文地址: /boutique/detail/tanheafice
系列文章
更多 icon
同类精品
更多 icon
继续加载