class NacosRepository implements ConfigurationRepository {

    @Override
    public void watch(final String key, final DataChangedEventListener listener) {
        try {
            String dataId = pathToKey(key);
            String group = nacosProperties.getValue(NacosPropertyKey.GROUP);
            configService.addListener(dataId, group, new Listener() {
                
                @Override
                public Executor getExecutor() {
                    return null;
                }
                
                @Override
                public void receiveConfigInfo(final String configInfo) {
                    listener.onChange(new DataChangedEvent(key, configInfo, ChangedType.UPDATED));
                }
            });
        } catch (final NacosException ex) {
            log.debug("Nacos watch key exception for: {}", ex.toString());
        }
    }

}