Skip to content

Instantly share code, notes, and snippets.

@anmol2709
Last active November 12, 2018 06:59
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 anmol2709/df938b1661b8e66aca3723b28ac034b4 to your computer and use it in GitHub Desktop.
Save anmol2709/df938b1661b8e66aca3723b28ac034b4 to your computer and use it in GitHub Desktop.
val intermediateFlow =Flow[ConsumerRecord[Array[Byte], String]].map { kafkaMessage =>
// Parsing the record as Company Object
val company = Json.parse(kafkaMessage.value()).as[Company]
val companyLocation = company.location
// Transform message so that we can write to elastic
WriteMessage.createIndexMessage(companyLocation, company)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment