@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    @ConditionalOnMissingBean(name = "restfulServiceRegistry")
    public ServiceRegistry restfulServiceRegistry(
        final CasConfigurationProperties casProperties,
        final ObjectProvider<List<ServiceRegistryListener>> serviceRegistryListeners,
        final ConfigurableApplicationContext applicationContext) {
        return BeanSupplier.of(ServiceRegistry.class)
            .when(CONDITION.given(applicationContext))
            .supply(() -> {
                val registry = casProperties.getServiceRegistry().getRest();
                LOGGER.debug("Creating REST-based service registry using endpoint [{}]", registry.getUrl());
                return new RestfulServiceRegistry(applicationContext,
                    Optional.ofNullable(serviceRegistryListeners.getIfAvailable()).orElseGet(ArrayList::new), registry);
            })
            .otherwiseProxy()
            .get();
    }
This is {@link CasRestServiceRegistryAutoConfiguration}.

@author Misagh Moayyed
@since 5.2.0
support/cas-server-support-rest-service-registry/src/main/java/org/apereo/cas/config/CasRestServiceRegistryAutoConfiguration.java