springboot集成kafka发消息报Exception thrown when sending a message with key= and payload=‘1‘ to topic test

报错 Exception thrown when sending a message with key= and payload='1' to topic test

本地环境 springboot集成kafka发消息报错Exception thrown when sending a message with key='' and payload='1' to topic test

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

解决办法:

修改kafka配置文件server.properties

listeners=PLAINTEXT://{内网ip}:9092

advertised.listeners=PLAINTEXT://{外网ip}:9092

重新启动本地项目,发送消息成功,并且DEBUG 日志级别下会打印心跳日志
 

报错:  kafka Exception thrown when sending a message with key='null'

org.springframework.kafka.support.LoggingProducerListener [76] - Exception thrown when sending a message with key=’null’ and payload=’2017-11-14 15:36:53|iZbp1115ogry6vyp418vplZ|192.168.3.1|{“token”:”708037c594e04850bfd48f82fa862dd…’ to topic
解决:

kafka Exception thrown when sending a message with key='null'_夜华_的博客-CSDN博客

/etc/hosts中加主机名和ip 映射

配置hosts
10.10.3.11 bj-6-dqy-msg-queue01
10.10.3.12 bj-6-dqy-msg-queue02
10.10.3.13 bj-6-dqy-msg-queue03

127.0.0.1 bj-6-dqy-msg-queue01

还有检查一下kafka集群是否正常, 网络是否通/ 我就是网络不通  telnet 失败, 最后去掉防火墙后就正常了

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值