Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ayushi24041992/d52f0deece12f90faa53630eb59744e2 to your computer and use it in GitHub Desktop.
Save ayushi24041992/d52f0deece12f90faa53630eb59744e2 to your computer and use it in GitHub Desktop.
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