public KafkaTemplate<K, V> getKafkaTemplate(final Serializer<K> keySerializer,
                                                final Serializer<V> valueSerializer) {
        val producerFactory = new DefaultKafkaProducerFactory<>(getProducerConfiguration(), keySerializer, valueSerializer);
        return new KafkaTemplate<>(producerFactory);
    }
Gets kafka template.

@param keySerializer   the key serializer
@param valueSerializer the value serializer
@return the kafka template
support/cas-server-support-kafka-core/src/main/java/org/apereo/cas/kafka/KafkaObjectFactory.java