kafka Failed to send messages after 3 tries.
在kafka0.8开发过程中 生产者测试用例碰到了
Exception in thread "main" kafka.common.FailedToSendMessageException: Failed to send messages after 3 tries.
at kafka.producer.async.DefaultEventHandler.handle(DefaultEventHandler.scala:90)
at kafka.producer.Producer.send(Producer.scala:76)
at kafka.javaapi.producer.Producer.send(Producer.scala:33)
at com.tuan55.kafka.test.TestP.main(TestP.java:20)
这样的错误。
起初以为是网络问题,经确认网络没有问题。
Properties props = new Properties();
props.put("metadata.broker.list", "xx.xx.xx.xx:9092");
props.put("serializer.class", "kafka.serializer.StringEncoder");
props.put("request.required.acks", "1");
ProducerConfig config = new ProducerConfig(props);
Producer<String, String> producer = new Producer<String, String>(config);
KeyedMessage<String, String> km = new KeyedMessage<String, String>("mm", "key-1", "content-1-中文");
producer.send(km);
producer.close();
这是生产者的代码 在向服务器发起连接后,在kafka的服务器配置kafka server.properties文件配置zookeeper使用了机器名,这时候kafka会在本地查找zookeeper
那么如果我们的hosts 中没有做hosts的配置 kafka经多次尝试连接不上就会报上面的错误。
解决办法:1、配置hosts文件 做zookeeper服务器的映射配置。
2、更改kafaka host.name
相关推荐
log4j:ERROR Failed to rename
kafka是一个分布式消息发布订阅系统,它最初由LinkedIn公司基于独特的设计实现为一个分布式的提交日志系统( a distributed commit log),,之后成为Apache项目的一部分。Kafka系统快速、可扩展并且可持久化。它的...
Flink无法获取Kafka Topic Metadata异常及解决.docx
log4j:ERROR Failed to rename错误解决办法 http://www.blogjava.net/DreamAngel/archive/2011/11/10/363400.html
log4j:ERROR Failed to rename错误; 网上查找了下原因,大概意思是日志文件始终被占有,所以当log4j对日志文件进行rename时,就发生了Failed to rename错误 。要修改log4j的源码,附件是我修改好后的,方便大家...
Waiting for acknowledgements, and resending messages as necessary due to communication failures or Kafka-reported errors Buffering messages to handle transient load spikes and Kafka-related problems...
kafkatool客户端工具,查询kafka中的信息。
主要介绍了Spring Boot集群管理工具KafkaAdminClient使用方法解析,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友可以参考下
1、图形化界面可以直观地查看 Kafka 的 Topic 里的内容 2、自由设置 Kafka 数据展示格式 3、使用 Kafka Tool 创建/删除 Topic 4、使用 Kafka Tool 模拟发送 Messages
kafka连接工具
This book is here to help you get familiar with Apache Kafka and to solve your challenges related to the consumption of millions of messages in publisher-subscriber architectures. It is aimed at ...
It provides an intuitive UI that allows one to quickly view objects within a Kafka cluster as well as the messages stored in the topics of the cluster. It contains features geared towards both ...
Learning Apache Kafka Second Edition provides you with step-by-step, practical examples that help you take advantage of the real power of Kafka and handle hundreds of megabytes of messages per second ...
Chapter 3, Kafka Design, discusses the design concepts used to build the solid foundation for Kafka. It also talks about how Kafka handles message compression and replication in detail. Chapter 4, ...
kafka kafka kafka kafka kafka
kafka to redis2
kafka
emq连接kafka,并发布消息到kafka的emq插件。插件主要使用emq的钩子函数,将数据通过ekaf发送到kafka中。
kafka kafka kafka