Small utility to retrieve current and future records from Kafka topics in a flow, written in .
val kafkaFlow = KafkaFlow<String>(bootstrapServers, StringDeserializer::class.java)
val twoMessagesFromTopic = kafkaFlow.startFlow("a.Topic").take(2).toList()
You can also simply stream "forever"
val kafkaFlow = KafkaFlow<String>(bootstrapServers, StringDeserializer::class.java)
kafkaFlow.startFlow("a.Topic").collect {
logger.info { "Just got this string from the topic: $it"}
}