kafkaReceiver

fun <K, V> kafkaReceiver(options: MutableReceiverOptions<K, V>.() -> Unit): KafkaReceiver<K, V>

This function creates a KafkaReceiver using provided receiver options.

Return

a KafkaReceiver.

Example usage:

val receiver = kafkaReceiver<String, String> {
keyDeserializer { _, data -> String(data) }
valueDeserializer { _, data -> String(data) }

properties {
BOOTSTRAP_SERVERS_CONFIG to "localhost:9092"
GROUP_ID_CONFIG to "my-group-id"
AUTO_OFFSET_RESET_CONFIG to "earliest"
}
}

Parameters

options

A lambda with receiver to configure MutableReceiverOptions.