@Bean
    @RefreshScope(proxyMode = ScopedProxyMode.DEFAULT)
    public KafkaOperations<String, DistributedCacheObject<RegisteredService>> registeredServiceDistributedKafkaTemplate(
        final ConfigurableApplicationContext applicationContext,
        final CasConfigurationProperties casProperties) {
        return BeanSupplier.of(KafkaOperations.class)
            .when(CONDITION.given(applicationContext.getEnvironment()))
            .supply(() -> {
                val kafka = casProperties.getServiceRegistry().getStream().getKafka();
                val mapper = new RegisteredServiceJsonSerializer(applicationContext).getObjectMapper();
                val factory = new KafkaObjectFactory<String, DistributedCacheObject<RegisteredService>>(kafka.getBootstrapAddress());
                return factory.getKafkaTemplate(new StringSerializer(), new JsonSerializer<>(mapper));
            })
            .otherwiseProxy()
            .get();
    }
This is {@link CasServicesStreamingKafkaAutoConfiguration}.

@author Misagh Moayyed
@since 6.3.0
support/cas-server-support-service-registry-stream-kafka/src/main/java/org/apereo/cas/config/CasServicesStreamingKafkaAutoConfiguration.java