kafkaSender

fun <K, V> kafkaSender(options: MutableSenderOptions<K, V>.() -> Unit): KafkaSender<K, V>

This function creates a KafkaSender using provided sender options.

Return

a KafkaSender.

Example usage:

val sender = kafkaSender<String, String> {
keySerializer { _, data -> data.encodeToByteArray() }
valueSerializer { _, data -> data.encodeToByteArray() }

properties {
BOOTSTRAP_SERVERS_CONFIG to "localhost:9092"
}
}

Parameters

options

A lambda with receiver to configure MutableSenderOptions.