@Bean
    @ConditionalOnMissingBean(name = "mongoDbServiceRegistry")
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public ServiceRegistry mongoDbServiceRegistry(
        @Qualifier("mongoDbServiceRegistryTemplate")
        final MongoOperations mongoDbServiceRegistryTemplate,
        final ObjectProvider<List<ServiceRegistryListener>> serviceRegistryListeners,
        final CasConfigurationProperties casProperties,
        final ConfigurableApplicationContext applicationContext) {
        val mongo = casProperties.getServiceRegistry().getMongo();
        return new MongoDbServiceRegistry(applicationContext, mongoDbServiceRegistryTemplate, mongo.getCollection(),
            Optional.ofNullable(serviceRegistryListeners.getIfAvailable()).orElseGet(ArrayList::new));
    }
This is {@link CasMongoDbServiceRegistryAutoConfiguration}.

@author Misagh Moayyed
@since 5.0.0
support/cas-server-support-mongo-service-registry/src/main/java/org/apereo/cas/config/CasMongoDbServiceRegistryAutoConfiguration.java