@Override
    public boolean serviceExists(final String key) {
        try {
            List<Instance> instances = namingService.selectInstances(key, groupName, true);
            return !instances.isEmpty();
        } catch (NacosException e) {
            LOGGER.error("nacos registry Error checking Nacos service existence: {}", e.getMessage(), e);
            throw new ShenyuException(e);
        }
    }
The type Nacos instance register repository.
shenyu-registry/shenyu-registry-nacos/src/main/java/org/apache/shenyu/registry/nacos/NacosInstanceRegisterRepository.java