Created
May 17, 2019 06:28
-
-
Save ayushi24041992/d52f0deece12f90faa53630eb59744e2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SampleMessageSerializer extends Serializer[Message] { | |
private val gson: Gson = new Gson() | |
override def configure(configs: java.util.Map[String, _], isKey: Boolean): Unit = { | |
// nothing to do | |
} | |
override def serialize(topic: String, data: Message): Array[Byte] = { | |
gson.toJson(data).getBytes | |
} | |
override def close(): Unit = { | |
//nothing to do | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment