@Override
    public List<ProviderGroup> subscribe(ConsumerConfig config) {
        String appName = config.getAppName();
        if (!registryConfig.isSubscribe()) {
            // 注册中心不订阅
            if (LOGGER.isInfoEnabled(appName)) {
                LOGGER.infoWithApp(appName, LogCodes.getLog(LogCodes.INFO_REGISTRY_IGNORE));
            }
            return null;
        }
        if (!config.isSubscribe()) {
            return null;
        }
        try {
            List<ProviderInfo> providers = lookupHealthService(config);

            if (EventBus.isEnable(ConsumerSubEvent.class)) {
                ConsumerSubEvent event = new ConsumerSubEvent(config);
                EventBus.post(event);
            }

            return Collections.singletonList(new ProviderGroup().addAll(providers));
        } catch (SofaRpcRuntimeException e){
            throw e;
        }catch (Exception e) {
            throw new SofaRpcRuntimeException(LogCodes.getLog(LogCodes.ERROR_SUB_PROVIDER ,EXT_NAME), e);
        }
    }
@Test
    public void testSubscribe() {
        ProviderConfig<?> providerConfig = providerConfig("consul-test-1", 12200, 12201, 12202);
        registry.register(providerConfig);

        ConsumerConfig<?> consumerConfig = consumerConfig("consul-test-1");

        assertUntil(() -> {
            List<ProviderGroup> providerGroups = registry.subscribe(consumerConfig);
            Assert.assertEquals(1, providerGroups.size());
            Assert.assertEquals(3, providerGroups.get(0).size());
        }, 10, TimeUnit.SECONDS);

        ConsumerConfig<?> consumerConfigWithAnotherUniqueId = consumerConfig("consul-test-2");

        assertUntil(() -> {
            List<ProviderGroup> providerGroups = registry.subscribe(consumerConfigWithAnotherUniqueId);
            Assert.assertEquals(1, providerGroups.size());
            Assert.assertEquals(0, providerGroups.get(0).size());
        }, 10, TimeUnit.SECONDS);

        registry.unSubscribe(consumerConfig);
        registry.unSubscribe(consumerConfigWithAnotherUniqueId);
    }