报错信息 Error when sending message to topic xxx with key:null 在网上找了各种方法无果后,遂逐一检查配置,发现是客户端的hosts文件无映射。 环境 服务器端 server.properties listeners=PLAINTEXT://kafka1:9092 客户端 /etc/hosts中无对应的主机 解决办法 在客户端的/etc/hosts中增加对应的主机映射