https://kotlinlang.org logo
Title
a

Adam S

08/08/2022, 5:17 PM
Are you using Kafka Streams? Then you'll get a more Kotin-esque experience with Kotka Streams - now released on Maven Central! Benefits include • more idiomatic functions (like lambda parameters are at the end of the function) • named function arguments • no more backticks for functions • Kotlinx Serialization integration - convert any KSerializer to a Serde
val kTable: KTable<String, String> = ...

// before :(
kTable.toStream(Named.`as`("my-stream"))
  .foreach(
    { k, v -> println("key: $k, value: $v") },
    Named.`as`("for-each-print")
  )

// after!
kTable.toStream("my-stream")
  .forEach("for-each-print") { k, v ->
    println("key: $k, value: $v")
  }