在springcloud集成kafka,发送消息时报错:

2018-08-15 16:01:34.159 [http-nio-8081-exec-1] INFO  org.apache.kafka.common.utils.AppInfoParser - Kafka version : 0.10.1.1

2018-08-15 16:01:34.159 [http-nio-8081-exec-1] INFO  org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : f10ef2720b03b247

2018-08-15 16:01:36.189 [http-nio-8081-exec-5] INFO  com.lolaage.kafka.KafkaSender - 发送消息:123456

2018-08-15 16:02:04.389 [kafka-producer-network-thread | producer-2] ERROR o.s.kafka.support.LoggingProducerListener - Exception thrown when sending a message with key='null' and payload='{-1, 1, 11, 99, 111, 110, 116, 101, 110, 116, 84, 121, 112, 101, 0, 0, 0, 18, 34, 97, 112, 112, 108,...' to topic messages:

org.apache.kafka.common.errors.TimeoutException: Expiring 2 record(s) for messages-0 due to 30012 ms has passed since batch creation plus linger time

 

网上说法:kafka服务器上没有配置host和名称相对应,或者kafka需要重启

经常尝试均不行,经检查日志,往上查找发现:

2018-08-15 16:01:00.438 [-C-1] INFO  o.a.k.c.consumer.internals.AbstractCoordinator - Marking the coordinator nt_web1:9092 (id: 2147483647 rack: null) dead for group anonymous.6fce406b-0835-4acb-bc3a-dd4ae5ce1014

 应该还是通过nt_web1查找不到服务器,

 

后在本地的host文件中配置,192.168.100.91 nt_web1。成功解决。。。。。。

相关文章:

  • 2021-09-06
  • 2022-12-23
  • 2021-12-12
  • 2021-09-11
  • 2021-04-27
  • 2022-12-23
  • 2021-04-07
  • 2022-12-23
猜你喜欢
  • 2022-03-10
  • 2017-12-04
  • 2021-10-03
  • 2021-08-05
  • 2021-07-12
  • 2021-05-18
相关资源
相似解决方案