@Bean(destroyMethod = "shutdown")
        @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
        @ConditionalOnMissingBean(name = "casRegisteredServiceHazelcastInstance")
        public HazelcastInstance casRegisteredServiceHazelcastInstance(
            final ConfigurableApplicationContext applicationContext,
            final CasConfigurationProperties casProperties) {
            return BeanSupplier.of(HazelcastInstance.class)
                .when(CONDITION.given(applicationContext.getEnvironment()))
                .supply(() -> {
                    val name = DefaultCasRegisteredServiceStreamPublisher.class.getSimpleName();
                    LOGGER.debug("Creating Hazelcast instance [{}] to publish service definitions", name);
                    val stream = casProperties.getServiceRegistry().getStream().getHazelcast();
                    val hzConfig = stream.getConfig();
                    val duration = Beans.newDuration(stream.getDuration()).toMillis();

                    val mapConfig = HazelcastConfigurationFactory.buildMapConfig(hzConfig, name, TimeUnit.MILLISECONDS.toSeconds(duration));
                    val config = HazelcastConfigurationFactory.build(hzConfig, mapConfig);
                    return HazelcastInstanceFactory.getOrCreateHazelcastInstance(config);
                })
                .otherwiseProxy()
                .get();
        }
This is {@link CasServicesStreamingHazelcastAutoConfiguration}.

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