joan38 / kafka-streams-circe

Generic Serdes with Circe for Kafka Streams

GitHub

Kafka Streams Circe

Latest version

Generic Serdes with Circe for Kafka Streams

Installation

libraryDependencies += "com.goyeau" %% "kafka-streams-circe" % "<latest version>"

Example

import com.lightbend.kafka.scala.streams.DefaultSerdes._
import com.lightbend.kafka.scala.streams.ImplicitConversions._
import com.lightbend.kafka.scala.streams.StreamsBuilderS
import com.goyeau.kafka.streams.circe.CirceSerdes._
import io.circe.generic.auto._

case class Person(firstname: String, lastname: String, age: Int)

object Streams extends App {
  println("Starting streams")

  val streamsBuilder = new StreamsBuilderS()
  val testStream = streamsBuilder.stream[String, Person]("some-topic")
}