Skip to content

Instantly share code, notes, and snippets.

@anmol2709
Last active November 12, 2018 06:56
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/9042a31c6b1e8eb9e14df9f59a6b8650 to your computer and use it in GitHub Desktop.
Save anmol2709/9042a31c6b1e8eb9e14df9f59a6b8650 to your computer and use it in GitHub Desktop.
val consumerSettings = ConsumerSettings(system, new ByteArrayDeserializer, new StringDeserializer)
.withBootstrapServers("localhost:9092")
.withGroupId("akka-stream-kafka-test")
.withProperty(ConsumerConfig.AUTO_OFFSET_RESET_CONFIG, "earliest")
val kafkaSource: Source[ConsumerRecord[Array[Byte], String], Consumer.Control] =
Consumer.plainSource(consumerSettings, Subscriptions.topics("kafkaTopic"))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment