nacos服务对微服务客户端心跳检测原理

  1. 微服务注册到nacos中的代码

com.alibaba.nacos.client.naming.net.NamingProxy 的registerService(String serviceName, String groupName, Instance instance)方法。

less error.log |grep 头盔发送消息

public void registerService(String serviceName, String groupName, Instance instance) throws NacosException {
        
        NAMING_LOGGER.info("[REGISTER-SERVICE] {} registering service {} with instance: {}", namespaceId, serviceName,
                instance);
        
        final Map params = new HashMap(16);
        params.put(CommonParams.NAMESPACE_ID, namespaceId);
        params.put(CommonParams.SERVICE_NAME, serviceName);
        params.put(CommonParams.GROUP_NAME, groupName);
        params.put(CommonParams.CLUSTER_NAME, instance.getClusterName());
        params.put("ip", instance.getIp());
        params.put("port", String.valueOf(i

你可能感兴趣的:(SpringCloud,微服务,java,spring)