You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@dubbo.apache.org by "FancyKong (GitHub)" <gi...@apache.org> on 2019/01/28 08:21:17 UTC

[GitHub] [incubator-dubbo] FancyKong commented on issue #3369: 泛化调用生成的ReferenceConfig,在服务提供者异常的时候调用destory并不能释放zk链接等资源

/**
     * 连接消费服务
     *
     * @param config
     * @return
     */
    public GenericService genericService(GenericServiceConfig config) {
        ReferenceConfig<GenericService> referenceConfig = buildReferenceConfig(config);
        GenericService genericService = getServiceFromCache(referenceConfig);
        if (genericService != null) {
            return genericService;
        } else {
            log.info("该config对应的泛化服务不存在, config = {}", config);
            closeConsumer(config);
            return null;
        }
    }

/**
     * 关闭消费某个服务
     *
     * @param config 泛化服务配置
     */
    public void closeConsumer(GenericServiceConfig config) {
        ReferenceConfigCache cache = ReferenceConfigCache.getCache();
        cache.destroy(buildReferenceConfig(config));
    }





[ Full content available at: https://github.com/apache/incubator-dubbo/issues/3369 ]
This message was relayed via gitbox.apache.org for notifications@dubbo.apache.org