Created
August 22, 2015 02:46
-
-
Save rocketpages/cbe9d12853b24fdb12e4 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
implicit val actorSystem = ActorSystem("ReactiveKafka") | |
implicit val materializer = ActorMaterializer() | |
val kafka = new ReactiveKafka(host = "localhost:9092", zooKeeperHost = "localhost:2181") | |
val publisher = kafka.consume("lowercaseStrings", "groupName", new StringDecoder()) | |
val subscriber = kafka.publish("uppercaseStrings", "groupName", new StringEncoder()) | |
// consume lowercase strings from kafka and publish them transformed to uppercase | |
Source(publisher).map(_.toUpperCase).to(Sink(subscriber)).run() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment