我试图连接到远程卡夫卡动物园管理员( zookeeperhost:1234
通过SimpleConsumer),并拉动元数据,我已经指定的主题。 不过,我得到这个错误:
RunnerMain failed :java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
我跑的telnet zookeeperhost 1234,得到了以下几点:
Trying <ip addr of host>...
Connected to zookeeperhost.somedomain.com.
Escape character is '^]'.
因此,它看起来像我能到达的服务,没有安全/权限问题。
这里是我的代码:
SimpleConsumer consumer = new SimpleConsumer ("zookeeperhost", 1234, 100000, 64 * 1024, "leader_lookup");
List<String> topics = Collections.singletonList("some_event");
TopicMetadataRequest req = new TopicMetadataRequest(topics);
TopicMetadataResponse resp = consumer.send(req); //this is the line that is causing the error
List<TopicMetadata> metaData = resp.topicsMetadata();