I'm trying to connect to a remote kafka zookeeper (zookeeperhost:1234
) via SimpleConsumer, and pulling metadata for the topics that I've specified. However, I get this error:
RunnerMain failed :java.io.EOFException: Received -1 when reading from channel, socket has likely been closed.
I ran telnet zookeeperhost 1234 and got the following:
Trying <ip addr of host>...
Connected to zookeeperhost.somedomain.com.
Escape character is '^]'.
So it looks like I am able to reach the service, there is no security/permission issue.
Here is my code:
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();