Skip to content

Instantly share code, notes, and snippets.

@anmol2709
Last active Nov 12, 2018
Embed
What would you like to do?
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