brainlag / JavaNSQClient

Fast Java client for NSQ
MIT License
90 stars 57 forks source link

Nullpointer Exception while connecting consumer. #37

Closed vikash-tiwari closed 7 years ago

vikash-tiwari commented 7 years ago

JsonNode jsonNode = mapper.readTree(new URL(addr + "/lookup?topic=" + topicEncoded)); LogManager.getLogger(this).debug("Server connection information: {}", jsonNode); JsonNode producers = jsonNode.get("data").get("producers");

jsonNode value is not having "data" key but rather "producers" is in the same level: {"channels":["test1"],"producers":[{"remote_address":"127.0.0.1:52354","hostname":"vikash.tiwari","broadcast_address":"vikash.tiwari","tcp_port":4150,"http_port":4151,"version":"1.0.0-compat"}]}

Producer and Consumer connection code is same as in instructions.

agustincastanio commented 7 years ago

+1

vikash-tiwari commented 7 years ago

@brainlag: I have created a PR for the solution along with backward compatibility.