Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

💡 Query node data from the configuration file. #105

Merged
merged 2 commits into from
Jun 2, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
package com.crossoverjie.cim.route.kit;

import com.alibaba.fastjson.JSON;
import com.crossoverjie.cim.route.config.AppConfiguration;
import java.util.List;
import lombok.extern.slf4j.Slf4j;
import org.I0Itec.zkclient.IZkChildListener;
Expand All @@ -24,6 +25,8 @@ public class ZKit {
@Autowired
private ZkClient zkClient;

@Autowired
private AppConfiguration appConfiguration;



Expand All @@ -33,7 +36,7 @@ public class ZKit {
* @return
*/
public List<String> getAllNode(){
List<String> children = zkClient.getChildren("/route");
List<String> children = zkClient.getChildren(appConfiguration.getZkRoot());
log.info("Query all node =[{}] success.", JSON.toJSONString(children));
return children;
}
Expand Down