Skip to content

Commit

Permalink
Kafka 2.3.0 API changes
Browse files Browse the repository at this point in the history
  • Loading branch information
NeQuissimus committed Sep 28, 2019
1 parent 49cffee commit 08683a7
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 11 deletions.
4 changes: 1 addition & 3 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,7 @@ libraryDependencies ++= Seq(
"io.circe" %% "circe-generic" % "0.11.1" % Test,
"io.circe" %% "circe-parser" % "0.11.1",
"org.apache.kafka" % "kafka-clients" % "2.3.0",
compilerPlugin("com.github.ghik" %% "silencer-plugin" % "1.4.2"),
"com.github.ghik" %% "silencer-lib" % "1.4.2",
"com.lihaoyi" %% "utest" % "0.6.7" % Test
"com.lihaoyi" %% "utest" % "0.6.7" % Test
)

testFrameworks += new TestFramework("utest.runner.Framework")
Expand Down
8 changes: 0 additions & 8 deletions src/main/scala/ImplicitSerde.scala
Original file line number Diff line number Diff line change
@@ -1,9 +1,5 @@
package nequi.circe

import java.util.{ Map => JMap }

import com.github.ghik.silencer.silent

import io.circe.{ Decoder, Encoder }
import io.circe.parser._

Expand All @@ -14,17 +10,13 @@ package object kafka {
private[kafka] val stringSerde = Serdes.String()

implicit def encoder2serializer[T <: AnyRef](implicit encoder: Encoder[T]): Serializer[T] = new Serializer[T] {
def close(): Unit = {}
@silent def configure(configs: JMap[String, _], isKey: Boolean): Unit = {}
def serialize(topic: String, data: T): Array[Byte] =
if (data eq null) null.asInstanceOf[Array[Byte]]
else
stringSerde.serializer.serialize(topic, encoder(data).noSpaces)
}

implicit def decoder2deserializer[T <: AnyRef](implicit decoder: Decoder[T]): Deserializer[T] = new Deserializer[T] {
def close(): Unit = {}
@silent def configure(config: JMap[String, _], isKey: Boolean): Unit = {}
def deserialize(topic: String, data: Array[Byte]): T =
if (data eq null) null.asInstanceOf[T]
else {
Expand Down

0 comments on commit 08683a7

Please sign in to comment.