irpas技术客

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

irpas 6920

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:intDefault:3000 (3 seconds)Valid Values:Importance:high

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

? ?默认是30秒超时,我调整为30分钟

?


1.本站遵循行业规范,任何转载的稿件都会明确标注作者和来源;2.本站的原创文章,会注明原创字样,如未注明都非原创,如有侵权请联系删除!;3.作者投稿可能会经我们编辑修改或补充;4.本站不提供任何储存功能只提供收集或者投稿人的网盘链接。

标签: #error #Sending #fetch #request #epochINITIAL #To