LD is tigger forever,CG are not brothers forever, throw the pot and shine forever.
Modesty is not false, solid is not naive, treacherous but not deceitful, stay with good people, and stay away from poor people.
talk is cheap, show others the code and KPI, Keep progress,make a better result.
Survive during the day and develop at night。
目录
概 述
注册中心:

如上图:命名服务:
根据上层的数据库字段:

我们挑出list 为例:
String namespaceId = WebUtils.optional(request, CommonParams.NAMESPACE_ID, Constants.DEFAULT_NAMESPACE_ID);
String serviceName = WebUtils.required(request, CommonParams.SERVICE_NAME);
NamingUtils.checkServiceNameFormat(serviceName);
String agent = WebUtils.getUserAgent(request);
String clusters = WebUtils.optional(request, "clusters", StringUtils.EMPTY);
String clientIP = WebUtils.optional(request, "clientIP", StringUtils.EMPTY);
int udpPort = Integer.parseInt(WebUtils.optional(request, "udpPort", "0"));
boolean healthyOnly = Boolean.parseBoolean(WebUtils.optional(request, "healthyOnly", "false"));
String app = WebUtils.optional(request, "app", StringUtils.EMPTY);
Subscriber subscriber = new Subscriber(clientIP + ":" + udpPort, agent, app, clientIP, namespaceId, serviceName,
udpPort, clusters);
return getInstanceOperator().listInstance(namespaceId, serviceName, subscriber, clusters, healthyOnly);
前台只是传参,调用getInstanceOperator().listInstance的方法
首先会调用:
Service service = getService(namespaceId, serviceName, true);
判断客户端订阅的逻辑。
服务存储获取数据得到了服务信息。
返回到控制层。
返回服务器信息。
小结
参考资料和推荐阅读
1.链接: link
本文介绍了Nacos命名服务的实例列表操作流程,涉及参数解析、服务注册与获取、客户端订阅逻辑,以及如何通过API获取服务器信息。还提供了参考资料和推荐阅读列表,帮助读者深入了解Nacos命名中心的原理与实践应用。
1249

被折叠的 条评论
为什么被折叠?



