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 org.apache.kafka.streams.scala.StreamsBuilder

import org.apache.kafka.streams.scala.ImplicitConversions._
import org.apache.kafka.streams.scala.Serdes._
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 StreamsBuilder
  val testStream = streamsBuilder.stream[String, Person]("some-topic")
}