服务器配置好了,用本地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.
kafkaConsumer.poll是一个长轮询,持续的向kafka集群获取新的消息。
你的答案