private List<ProviderInfo> findService(ConsumerConfig config) {

        String uniqueName = buildUniqueName(config, config.getProtocol());
        //computeIfAbsent avoid creating multiple informers and some Listeners failure due to multiple subscribe
        PolarisWatcher polarisWatcher = polarisWatchers.computeIfAbsent(uniqueName,key->{
            PolarisWatcher watcher = new PolarisWatcher(buildNameSpace(config.getAppName()), buildServiceName(config), config.getProtocol(), consumerAPI, properties);
            watcher.init();
            return watcher;
        });
        polarisWatcher.addListener(config.getProviderInfoListener());
        return polarisWatcher.currentProviders();
    }
the main logic of polaris registry, similar to consul

@author <a href=mailto:bner666@gmail.com>ZhangLibin</a>
registry/registry-polaris/src/main/java/com/alipay/sofa/rpc/registry/polaris/PolarisRegistry.java