Skip to content

Commit 9f5d767

Browse files
vikash-tiwaribrainlag
authored andcommitted
37: provide compatibility with nsq1.0.0-compact, ensure backward compatibility for discovery check,
NSQ has changed the JSON format of the result
1 parent 329b747 commit 9f5d767

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/main/java/com/github/brainlag/nsq/lookup/DefaultNSQLookup.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ public Set<ServerAddress> lookup(String topic) {
4242
String topicEncoded = URLEncoder.encode(topic, Charsets.UTF_8.name());
4343
JsonNode jsonNode = mapper.readTree(new URL(addr + "/lookup?topic=" + topicEncoded));
4444
LogManager.getLogger(this).debug("Server connection information: {}", jsonNode);
45-
JsonNode producers = jsonNode.get("data").get("producers");
45+
JsonNode producers = jsonNode.findValue("producers");
4646
for (JsonNode node : producers) {
4747
String host = node.get("broadcast_address").asText();
4848
ServerAddress address = new ServerAddress(host, node.get("tcp_port").asInt());

0 commit comments

Comments
 (0)