Skip to content

Instantly share code, notes, and snippets.

@aludwiko
Created November 17, 2017 12:37
Show Gist options
  • Save aludwiko/c5a87ffcb76d88c9331334cb8004e135 to your computer and use it in GitHub Desktop.
Save aludwiko/c5a87ffcb76d88c9331334cb8004e135 to your computer and use it in GitHub Desktop.
Source(1 to 10)
 .flatMapConcat { i =>
  Source.single(i)
  .map(toKafkaRecord)
  .via(Producer.flow(producerSettings))
 }
 .runForeach(i => println(s"${i.message.passThrough} sent to kafka"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment