kafka消费者无法消费消息,阿里云centos7

ff 发表于: 2018-04-25   最后更新时间: 2021-08-14 15:44:23   6,568 游览

服务器配置好了,用本地javaApi测试的时候

总是卡在

ConsumerRecords<String, String> records = kafkaConsumer.poll(2000);

这一行代码 底层好像是无限循环.

日志
INFO 2018-04-25 10:19:15 org.apache.kafka.common.utils.AppInfoParser Kafka version : 0.11.0.2 
INFO 2018-04-25 10:19:15 org.apache.kafka.common.utils.AppInfoParser Kafka commitId : 73be1e1168f91ee2 
INFO 2018-04-25 10:19:17 org.apache.kafka.clients.consumer.internals.AbstractCoordinator Discovered coordinator 172.16.183.191:9094 (id: 2147483644 rack: null) for group group1. 
INFO 2018-04-25 10:19:17 org.apache.kafka.clients.consumer.internals.ConsumerCoordinator Revoking previously assigned partitions [] for group group1 
INFO 2018-04-25 10:19:17 org.apache.kafka.clients.consumer.internals.AbstractCoordinator (Re-)joining group group1 
WARN 2018-04-25 10:19:38 org.apache.kafka.clients.NetworkClient Connection to node 2147483644 could not be established. Broker may not be available. 
INFO 2018-04-25 10:19:38 org.apache.kafka.clients.consumer.internals.AbstractCoordinator Marking the coordinator 172.16.183.191:9094 (id: 2147483644 rack: null) dead for group group1 
WARN 2018-04-25 10:19:59 org.apache.kafka.clients.NetworkClient Connection to node 2 could not be established. Broker may not be available. 
WARN 2018-04-25 10:20:20 org.apache.kafka.clients.NetworkClient Connection to node 1 could not be established. Broker may not be available. 
WARN 2018-04-25 10:20:41 org.apache.kafka.clients.NetworkClient Connection to node 3 could not be established. Broker may not be available. 
WARN 2018-04-25 10:21:02 org.apache.kafka.clients.NetworkClient Connection to node 2 could not be established. Broker may not be available. 
WARN 2018-04-25 10:21:23 org.apache.kafka.clients.NetworkClient Connection to node 3 could not be established. Broker may not be available. 
WARN 2018-04-25 10:21:44 org.apache.kafka.clients.NetworkClient Connection to node 2 could not be established. Broker may not be available.
发表于 2018-04-25
ff
添加评论

kafkaConsumer.poll是一个长轮询,持续的向kafka集群获取新的消息。

你的答案

查看kafka相关的其他问题或提一个您自己的问题